当我调试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

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


当前回答

我从来没有找到问题的根源,但我能够解决这个问题。 我删除了谷歌Chrome应用程序缓存文件夹,解决了这个问题。

C: \用户[用户]\ AppData \ Local的谷歌的Chrome

其他回答

借阿迪亚特·穆巴拉克的东风

不能硬刷新,因为它只是在https上刷新。遵循一些相同的步骤。

1. Open chrome developer tools (ctrl + shift + i)
2. Network Tab at the top
3. Click Disable cache checkbox at the top (right under network tab for me).
4. Refresh page (while the developer tools is still open)

尝试了上面提到的所有方法(浏览器首选项、hsts等),但都不适合我。

我通过在主机别名后面添加一个.localhost来解决这个问题。在我的例子中,这个文件在windows下:%windir%\system32\drivers\etc\hosts

是这样的:

127.0.0.1    myproject.localhost
127.0.0.1    dev.project.localhost

为像我这样的懒人(在Chrome 67中工作)提供了一个懒惰和快速的解决方案。

只需在隐身模式下启动另一个Chrome窗口,使用“隐身窗口”选项(CTRL + SHIFT + N)。不需要删除缓存,不需要深入Chrome设置等。

我也面临着同样的问题,但只是在Chrome金丝雀和寻找一个解决方案,我发现了这篇文章。

下一个版本的Chrome将强制所有以。dev(和。foo)结尾的域通过预加载的HTTP严格传输安全(HSTS)头重定向到HTTPs。

{ "name": "dev", "include_subdomains": true, "mode": "force-https" },
{ "name": "foo", "include_subdomains": true, "mode": "force-https" },

所以,改变你的域名。

chrome://net-internals/#hsts 

在“删除域安全策略”中输入localhost,按“删除”键。

现在转到

chrome://settings/clearBrowserData 

选中“缓存的图像和文件”复选框,然后按“清除数据”按钮。