Azure应用程序服务 - 在Kestrel .Net Core 2.2 Web应用程序中使用web.config中的httpRedirect [英] Azure app service - using httpRedirect in web.config in Kestrel .Net Core 2.2 web app

查看:86
本文介绍了Azure应用程序服务 - 在Kestrel .Net Core 2.2 Web应用程序中使用web.config中的httpRedirect的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近将网站移植到.Net Core 2.2。 以前我们有一个名为"contrib"的文件夹。使用包含以下文本的web.config文件。 它会将contrib文件夹中的任何文件引用重定向到我们CDN上的文件夹。

Recently ported site to .Net Core 2.2.  Previously we had a folder called "contrib" with a web.config file containing the text below.  It redirects any file references in the contrib folder to a folder on our CDN.

< configuration>

   &NBSP; < system.webServer>

        < httpRedirect enabled =" true"目的地= QUOT; HTTPS://cdn.somewhere.com/contrib/llc" httpResponseStatus = QUOT;常驻" />
$
    < /system.webServer>

< / configuration>

对于.Net Core网站,我创建了wwwroot / contrib文件夹并放入web.config文件。 它在发布时被忽略。 

For the .Net Core site I created folder wwwroot/contrib and dropped in the web.config file.  It was ignored when published. 

然后我尝试在项目级别创建一个web.config文件( D:\\\\\\\\\\\ wwwroot \ www.root )包含:

Then I tried creating a web.config file in the project level (D:\home\site\wwwroot\wwwroot) containing:

<?xml version =" 1.0 " encoding =" utf-8"?>

推荐答案

感谢您的问题Brian。可能最快的解决方案是看看我们是否可以关闭web.config文件的自动生成。让我一起来看看目前是否可行,并尽快回复你。
Thanks for your question Brian. Probably the quickest solution would be to see if we can turn off the auto generation of the web.config file. Let me dig around to see if this is currently possible and get back to you shortly.


这篇关于Azure应用程序服务 - 在Kestrel .Net Core 2.2 Web应用程序中使用web.config中的httpRedirect的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆