出现这个问题,首要的解决办法就是 「 清空浏览器缓存 」 或者在 Chrome 浏览器中输入以下命令
chrome://settings/resetProfileSettings?origin=userclick
打开重置对话框,直接重置,然后重启浏览器即可
缘起
今天在写 HTTP/2 服务器推送教程的时候,给本地的 localhost
随意配置了好多东西,这些东西到后来都忘记得一干二净,根本不知道做错了啥
回忆了下,跟浏览器相关的配置主要有以下几个点
-
修改
/etc/hosts
打开了多个localhost
的 ip127.0.0.1 localhost ::1 localhost fe80::1%lo0 localhost
-
修改了 Chrome 打开
localhost
https 支持 -
修改了 nginx 给
localhost
强制 http 跳转到https
然后,发生了啥事,当我一步一步退回来后,打开 http://localhost:8080
就发生 502 错误了,Tornado 后台显示的结果是
[I 180812 19:15:10 http1connection:252] Malformed HTTP message from ::1: Malformed HTTP headers: '\n{q\x86ÐÑxÃ&İ\x88\x01dÓc9ÇÍ 5\x99"\x0cÖ\x83\t%4\x1faQ¯F\rR\x84&0s\x05\x1e»å\x87\x8dÒÖ¼Z\x1d%\x00"ÚÚ\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13' [I 180812 19:15:10 http1connection:252] Malformed HTTP message from ::1: Malformed HTTP request line
或者是下面的错误
Malformed HTTP message from ::1: Malformed HTTP headers: ''
我一开始以为是 /etc/hosts
中的 localhost
域名设置错误,于是改成如下
127.0.0.1 localhost # ::1 localhost # fe80::1%lo0 localhost
但是问题还没解决
诚惶诚恐,百度了好久,没结果,于是改成谷歌,终于得到某个答复,就是下面这个
「 清空浏览器缓存 」
或者在 Chrome 中输入以下命令来重置
chrome://settings/resetProfileSettings?origin=userclick
目前尚无回复