Nginx 安全响应头配置
六项必配响应头与上线顺序
六项必配响应头与上线顺序
Content-Security-Policy-Report-Only 观察 1-2 周,收集违规上报后再切换为强制 CSP。\n\n| 头 | 建议值 |\n|---|---|\n| Strict-Transport-Security | max-age=31536000; includeSubDomains |\n| X-Content-Type-Options | nosniff |\n| X-Frame-Options | SAMEORIGIN |\n| Referrer-Policy | strict-origin-when-cross-origin |\n| Permissions-Policy | geolocation=(), microphone=(), camera=() |\n| Content-Security-Policy | 按实际资源域逐步收紧 |\n\n同时关闭 server_tokens 与 PHP 的 expose_php。