关闭HSTS后清除Chrome/Edge带来的影响

246次阅读
13 条评论

共计 689 个字符,预计需要花费 2 分钟才能阅读完成。

前言

今天录制了一个关于 Puock 主题的基本安装和配置教程 ,但是由于我的站点以前有开过 HSTS,会导致我自己分配的本地域名 puockdemo.licoy.cn 浏览器会强制跳转使用 https 协议,所以今天就来盘盘它。

什么是 HSTS

HSTS 是 HTTP 严格传输安全(英语:HTTP Strict Transport Security,缩写:HSTS)是一套由互联网工程任务组发布的互联网安全策略机制。网站可以选择使用 HSTS 策略,来让浏览器强制使用 HTTPS 与网站进行通信,以减少会话劫持风险。
— 来自  维基百科

关闭

由于我的网站使用了 CDN 进行分发,所以我第一个考虑的就是 CDN 是不是开启了 HSTS,于是就去了云厂商的控制台,居然没有开启,反而在我的源站服务器里面手动添加了 nginx 的 header(说实话我自己都不知道什么时候加上去的),于是删除掉就好了,一般格式为:

add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;

清除浏览器缓存

Chrome

直接进入 chrome://net-internals/#hsts,可以在下图区域直接搜索你的域名(根域名):
关闭 HSTS 后清除 Chrome/Edge 带来的影响
然后在页面的最底部如下图所示区域删除:
关闭 HSTS 后清除 Chrome/Edge 带来的影响

Edge

Edge 的方法和 Chrome 类似,只是入口为:edge://net-internals/#hsts

后记

不过即使关闭了网站的 HSTS,将浏览器的 HSTS 记录也清除掉,重新访问有时候还是会出现莫名的 HSTS 记录,不知道是哪一步的妖魔鬼怪在作祟,等我找到了再把这部分更新上。

正文完
 
lucky
版权声明:本站原创文章,由 lucky 2022-07-04发表,共计689字。
转载说明:转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(13 条评论)
2024-04-29 22:50:04 回复

I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.

 Windows  Edge  英国伦敦伦敦
2024-07-29 09:15:51 回复

Thanks for sharing. I read many of your blog posts, cool, your blog is very good.

 Windows  Edge  美国加利福尼亚旧金山
2024-08-04 17:41:45 回复

Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?

 Windows  Edge  拉脱维亚Riga
2024-08-06 03:34:37 回复

purchase lasuna online cheap – buy generic himcolin online purchase himcolin pill

 Windows  Chrome  荷兰阿姆斯特丹阿姆斯特丹
2024-08-18 10:50:23 回复

besivance over the counter – how to get sildamax without a prescription buy sildamax online cheap

 Windows  Chrome  美国加利福尼亚旧金山
2024-08-20 23:20:30 回复

neurontin 100mg ca – azulfidine 500mg sale azulfidine 500 mg ca

 Windows  Chrome  美国加利福尼亚旧金山
2024-08-23 08:04:19 回复

buy benemid 500mg for sale – buy benemid online buy generic tegretol online

 Windows  Chrome  美国加利福尼亚旧金山
2024-08-26 17:31:49 回复

buy celebrex 200mg generic – celebrex cost order indomethacin 50mg online cheap

 Windows  Chrome  美国加利福尼亚旧金山
2024-08-27 08:43:17 回复

buy priligy tablets If it s a cyst, your doctor can puncture and drain it

 Windows  Chrome  俄罗斯莫斯科莫斯科
2024-08-27 17:50:24 回复

order mebeverine 135mg without prescription – order generic pletal 100 mg buy cilostazol 100 mg for sale

 Windows  Chrome  巴西圣保罗圣保罗
2024-08-31 07:24:39 回复

buy diclofenac 50mg for sale – cost voltaren 50mg aspirin 75mg over the counter

 Windows  Chrome  美国加利福尼亚旧金山
2024-09-05 00:52:51 回复

rumalaya sale – buy rumalaya without a prescription buy elavil for sale

 Windows  Chrome  美国加利福尼亚旧金山
2024-09-08 05:01:27 回复

cheap mestinon – order imuran 50mg for sale azathioprine 25mg oral

 Windows  Chrome  美国加利福尼亚旧金山