chore: add CSP/Permissions-Policy security headers and update production env vars
- Add Content-Security-Policy and Permissions-Policy headers to nginx config - Add same headers to next.config.mjs for dev/preview mode - Add Referrer-Policy to next.config.mjs (was only in nginx) - Generate production JWT/CMS secrets via openssl rand -base64 64 - Update README mark production env/security header task as complete
This commit is contained in:
@@ -121,6 +121,8 @@ http {
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-XSS-Protection "1; mode=block" always;
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://www.googletagmanager.com https://ssl.google-analytics.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https://www.google-analytics.com https://ssl.google-analytics.com; font-src 'self'; connect-src 'self' https://www.google-analytics.com https://ssl.google-analytics.com; frame-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self';" always;
|
||||
add_header Permissions-Policy "camera=(), microphone=(), geolocation=(), interest-cohort=()" always;
|
||||
|
||||
# 静态文件根目录
|
||||
root /var/www/novalon;
|
||||
|
||||
Reference in New Issue
Block a user