说明:
HSTS – HTTP Strict Transport Security,就是增加一个 HTTP 头字段,告诉浏览器,这个域名以后的访问默认为 HTTPS 访问。
方法一:通过源程序实现/万能实现方式:
# 技术人员可以通过改写 php/aspx/java 程序,增加一个 HTTP 头应答字段:
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
方法二:面向 Nginx 源服务器:
# 在配置站点域名的地方添加一行
add_header Strict-Transport-Security “max-age=31536000; includeSubdomains; preload”;
方法三:面向 Apache2 源服务器:
# 确保加载/启动一个模块
LoadModule headers_module modules/mod_headers.so# 在配置站点域名的地方添加一行
Header always set Strict-Transport-Security “max-age=31536000; includeSubdomains; preload”
主题测试文章,只做测试使用。发布者:Yusky,转转请注明出处:https://yusky.me/setting-hsts.html
评论列表(1条)
分享不错!