Bootstrap

漏洞扫描,解决缺少“X-XSS-Protection”,“X-Content-Type-Options”, “Content-Security-Policy”头问题

缺少“X-XSS-Protection”,“X-Content-Type-Options”, “Content-Security-Policy”头

用AppScan扫描网站,高危问题:缺少“X-XSS-Protection”,“X-Content-Type-Options”, “Content-Security-Policy”头解决方式
在这里插入图片描述

解决方法

将下面内容添加到nginx.conf 文件http 结构下

# security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Content-Security-Policy 
;