今天用360网站安全给自己的小站重新检测了下,99分
于是就查看了下漏洞的信息是轻微的X-Frame-Options头未设置
解决的办法也很简单
1、nginx,把下面这行添加到 ‘http’, ‘server’ 或者 ‘location’ 的配置中:
- add_header X-Frame-Options SAMEORIGIN;
2、Apache,需要把下面这行添加到 ‘site’ 的配置中:
- Header always append X-Frame-Options SAMEORIGIN
关于发现Robots.txt文件
可以设置成非搜索引擎禁止访问即可
- location = /robots.txt {
- if ($http_user_agent !~* "spider|bot|Python-urllib|pycurl") {
- return 403;
- }
- }
- 扫扫关注公众号
-
- 扫扫体验小程序
-