Files
stpweb/.deprecated/nginx/security_headers.conf
T
adamfandClaude Opus 5.5 30d6056bc0
Test and deploy / test (push) Successful in 1m35s
Test and deploy / deploy (push) Successful in 1m10s
Move the retired nginx and certbot into .deprecated
Nothing references nginx/ or certbot/ since the cutover to Caddy (daa2a46),
so they join quartz, hasura and autoheal in .deprecated/, with a README
entry on how to bring them back. The rollback steps in DEPLOYMENT.md §7 now
revert this commit and then the cutover. The host keeps ./certbot/conf (the
last certbot certificate, valid until 2027-01-20) and ./logs/nginx until the
rollback is no longer wanted; .gitignore still covers certbot/conf and
certbot/www for that reason.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-17 23:35:33 +00:00

23 lines
1.3 KiB
Plaintext

# Included at every level that sets at least one of its own add_headers.
# nginx replaces a parent's whole add_header set inside any block that
# declares one of its own, so without this include, locations like /assets/
# and /sound/ silently lose every security header the server block sets.
# Locations that add extra headers of their own (the /uploads/ blocks) can
# include this AND their own lines; the include plus their own add_header
# directives merge additively.
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
# Applied to the main document; the /uploads/ blocks override with their own
# locked-down CSP by declaring Content-Security-Policy again themselves
# (a later add_header of the same name within one response wins).
#
# ponytail: no site-wide CSP from nginx here. Gitea (proxied at /gitea/)
# relies on inline <script> blocks its own templates generate, so a shared
# script-src would need 'unsafe-inline' — which voids almost all of CSP's
# value. If a real CSP matters again, give the SPA document its own
# script-src 'self' location, separate from Gitea.