当我调试Visual Studio项目使用Chrome浏览器尝试重定向到https相当于我的web地址。我没有在web项目中启用SSL,并且开始URL是http URL。当我使用FireFox或IE进行调试时,我没有这个问题。

我重新安装了Chrome浏览器,解决了这个问题一天。没有下载任何插件的问题再次发生了第二天。

什么是使Chrome重定向localhost到https?

网络巡检显示: 请求URL:数据:text / html, chromewebdata 请求头 显示临时标题 User-Agent:Mozilla/5.0 (Windows NT 6.3;WOW64) AppleWebKit/537.36 (KHTML,像Gecko) Chrome/36.0.1985.143 Safari/537.36

这些选项卡中没有预览和响应数据。


当前回答

对于有同样问题的人,我通过按CTRL + SHIFT + DELETE删除整个浏览器缓存来解决。现在我可以在HTTP协议上访问我的本地主机网站。

其他回答

进入Chrome的设置,然后进入高级设置,在隐私和安全部分单击清除浏览数据,然后清除所有数据。我遵循了这些步骤,它对我很有效。希望它能帮助到一些人。

The issue could be replicated in VS 2019 also. This is caused due to "Enable Javascript debugging from Visual Studio IDE". The VS attaches to Chrome and it is a possibility that due to security or reasons known to Google and Microsoft, it sometimes fails to attach and you have this issue. I am able to run http and https with localhost from ASP net core 3.1 app. So while debugging in VS, go to the run with arrow -> IIS express, just below "Web Browser(Chrome)" select "Script Debugging (Disabled)".

参见文章:https://devblogs.microsoft.com/aspnet/client-side-debugging-of-asp-net-projects-in-google-chrome/

https://learn.microsoft.com/en-us/visualstudio/debugger/debugging-web-applications?view=vs-2019

总是退回到微软文档,以获得比谷歌更清楚的问题。

结果这个错误消息把我送进了兔子洞。

对我来说,问题是我试图在http上加载的页面未能返回响应(由于我的代码中的一个错误导致服务器崩溃)。

Chrome自动尝试https自动作为备份,而不是看到实际的错误(页面超时),我看到SSL错误,这是一个红鲱鱼。

修复底层服务器崩溃&导航回http://localhost:5000修复了我的问题。

Chrome 63强制。dev域通过预加载的HSTS自动转换为HTTPS。 快速修复:只需将.dev域更改为.localhost。

我找不到任何解决办法;而是重定向到我的网络。配置允许我继续工作(localhost),直到我找到导致问题的原因。

这本质上是一个将HTTPS转换为HTTP的重写规则;它似乎已经覆盖了之前将HTTP重定向到HTTPS的规则。

它需要在你的系统中。网络服务器> < /系统。web.config中的webServer>部分

    <rewrite>
  <rules>
    <clear />
    <rule name="Redirect to https" stopProcessing="true">
      <match url=".*" />
      <conditions>
        <add input="{HTTP}" pattern="off" ignoreCase="true" />
      </conditions>
      <action type="Redirect" url="http://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
    </rule>
  </rules>
</rewrite>