diff --git a/nginx/security-headers.conf b/nginx/security-headers.conf index e53d880..e754781 100644 --- a/nginx/security-headers.conf +++ b/nginx/security-headers.conf @@ -2,8 +2,10 @@ # that sets its own add_header (because add_header in a location REPLACES, not # merges, inherited headers — the classic nginx footgun). # -# HSTS + HTTP->HTTPS redirect are set at the Cloudflare edge (TLS terminates -# there), so they are intentionally NOT here. +# HSTS is set here at the origin (travels through the tunnel to the client) — host-scoped, +# NO includeSubDomains / preload (the *.bztmon.com wildcard points elsewhere, so forcing HTTPS +# on every subdomain would be dangerous). HTTP->HTTPS upgrade is handled by Cloudflare. +add_header Strict-Transport-Security "max-age=31536000" always; add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; connect-src 'self'; worker-src 'self'; manifest-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'; upgrade-insecure-requests" always; add_header X-Content-Type-Options "nosniff" always;