简体   繁体   English

禁用自动重定向到 https iis

[英]Disable automatic redirect to https iis

I have a problem to solve and despite my efforts I haven't found a solution.我有一个问题要解决,尽管我努力了,但我还没有找到解决方案。

I have a project running on IIS and not using the default ports 80 and 443 for http and https.我有一个在 IIS 上运行的项目,并且没有为 http 和 https 使用默认端口 80 和 443。 These ports are used by another environment running on the same machine.这些端口由在同一台机器上运行的另一个环境使用。 I use 8080 and 44307.我使用 8080 和 44307。

But on this environment I have a problem, when I try to access a page via http with port 8080 in the url, I am automatically redirected to https and port 44307.但是在这种环境下,我遇到了一个问题,当我尝试通过 url 中端口为 8080 的 http 访问页面时,我会自动重定向到 https 和端口 44307。

I don't have a Rewrite URL configured so I don't understand this redirection.我没有配置重写 URL,所以我不明白这个重定向。 This creates several problems at the project level and I would like to have solutions.这在项目级别产生了几个问题,我希望有解决方案。

This was answered here : https://serverfault.com/questions/502048/iis-7-0-unwanted-automatic-redirect-to-https这是在这里回答: https : //serverfault.com/questions/502048/iis-7-0-unwanted-automatic-redirect-to-https

IIS don't do that kind of redirection without an extra configuration. IIS 在没有额外配置的情况下不会进行这种重定向。 It's your app that is doing that.是您的应用程序在执行此操作。

I tested it on IIS 8, with ASP.Net Core.我在 IIS 8 上使用 ASP.Net Core 对其进行了测试。 When I removed app.UseHttpsRedirection() from the Configure method inside Startup.cs , the redirecting stopped, and I could access my site over HTTP当我从Startup.cs的 Configure 方法中删除app.UseHttpsRedirection() ,重定向停止,我可以通过 HTTP 访问我的网站

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM