Skip to content

如何为自己的站点开启HSTS

这里以Caddy为例,你需要在Caddyfile中修改header部分:

juniortree.com {
encode gzip
reverse_proxy 172.17.0.1:8000
header {
	Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
		}
}

你只需要添加其中的Strict-Transport-Security即可,需要注意的是,max-age必须为31536000,这样你才能提交到浏览器预加载列表中

image

贡献者

The avatar of contributor named as Liueic Aicnal Liueic Aicnal

页面历史