在使用 Chrome 浏览器的过程中,发现如果不小心在谷歌浏览器中输入了https域名之后,再次访问后续此域名都会强制跳转到https,本文记录防止强制 https 的解决方案。
HSTS 协议阻止 http 强制转换 https
HTTP Strict Transport Security¶ HTTP Strict Transport Security (HSTS) is an opt-in security enhancement specified through the use of a special response header. Once a supported browser receives this header that browser will prevent any communications from being sent over HTTP to the specified domain and will instead send all communications over HTTPS. HSTS is enabled by default. To disable this behavior use hsts: “false” in the configuration ConfigMap.
之后显示查询不到该域名的 hsts 记录表示成功
这个是暂时性的方法,一旦再次输入 https 协议访问该域名还是会变回去的。