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

解决方案
在nginx中添加配置
# 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 "default-src 'self' http: https://* data: blob: 'unsafe-eval' 'unsafe-inline';child-src 'none' " always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
# . files
location ~ /\.(?!well-known) {
deny all;
}
本文来自博客园,作者:King-DA,转载请注明原文链接:https://www.cnblogs.com/qingmuchuanqi48/articles/18175518

浙公网安备 33010602011771号