admin avatar

Openlitespeed /litespeed 添加HSTS的方法

🕜 by admin

编辑虚拟机的配置文件。添加一下代码即可

1
2
3
4
5
6
7
8
9
10
11
12
context / {
  type                    proxy
  handler                 gobbs
  extraHeaders            <<<END_extraHeaders
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
X-Content-Type-Options nosniff
X-XSS-Protection 1;mode=block
X-Frame-Options SAMEORIGIN
  END_extraHeaders

  addDefaultCharset       off
}
或者在后台-资源集-头部操作,添加下面代码

1
2
3
4
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
X-Content-Type-Options nosniff
X-XSS-Protection 1;mode=block
X-Frame-Options SAMEORIGIN

💘 相关文章

写一条评论