Deploy with Docker Compose / deploy (push) Successful in 26s
03e10be introduced the CSP before it was tested against the SPA's wasm
loader and the Gitea proxy. Gitea's own templates emit inline <script>
blocks, so the shared script-src would need 'unsafe-inline' to keep it
working — a CSP that weak nulls out most of its protection. Drop the
header site-wide; the /uploads/ locked-down CSP stays.
Co-Authored-By: Claude Code <[email protected]>
24 lines
1.3 KiB
Plaintext
24 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. The SPA needs
|
|
# 'wasm-unsafe-eval' for its Rust module, 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' 'wasm-unsafe-eval' location, separate from Gitea.
|