fix(security): security headers and /.well-known/security.txt in nginx
What
docs.traduora.co sent none of Content-Security-Policy / X-Frame-Options / Referrer-Policy / Permissions-Policy, its Server header carried the nginx version, and /.well-known/security.txt was a 404 (audit 2026-11-20, website security sweep).
This adds to the nginx server block:
add_header ... always(so 301s and 404s get them too):X-Content-Type-Options: nosniff,Referrer-Policy: strict-origin-when-cross-origin,X-Frame-Options: SAMEORIGIN,Content-Security-Policy: base-uri 'self'; object-src 'none'; frame-ancestors 'self',Permissions-Policy: camera=(), geolocation=(), microphone=(). Same baseline as ever.co and the other Ever websites. No HSTS here: the Cloudflare zone sends it.server_tokens off;location = /.well-known/security.txtanswered by nginx itself (RFC 9116,text/plain; charset=utf-8): Contactsecurity@ever.co, Expires 2027-11-19, Canonicalhttps://docs.traduora.co/.well-known/security.txt, Policyhttps://github.com/ever-co/ever-traduora/security/policy. It does not depend on Docusaurus copying a dot-directory out ofstatic/, and an exact-match location cannot be shadowed by a built file. It sets noadd_header, so it inherits the server-level set.- The asset location sets its own
Cache-Controladd_header, which drops the inherited ones in nginx, so it repeats the five headers. absolute_redirect off;: nginx's directory redirect downgraded to http (https://docs.traduora.co/docs->301 http://docs.traduora.co/docs/, measured live). A relativeLocationkeeps the client on https (same fix the other docs sites already have).
Everything else (absolute_redirect, error pages, redirects) is unchanged.
How it was checked
nginx -t and curl against nginx:alpine (1.31.9) in a throwaway ci-builds pod with a stub site: /, a doc page, the slash-less 301, a CSS asset, an .html file, a 404, the redirects and /.well-known/security.txt all answer with the five headers and Server: nginx (no version); security.txt is 200 text/plain; charset=utf-8 with the fields above. After the merge the image build and the live site get the same checks.
š¤ Generated with Claude Code
Summary by cubic
Fixes docs.traduora.co's nginx config: adds the ever.co baseline security headers, hides the nginx version, serves /.well-known/security.txt per RFC 9116, and fixes a directory redirect that downgraded https to http.
- Server-level headers use
alwaysso 301s and 404s carry them too; no HSTS because the Cloudflare zone sends it. - The asset location repeats the headers because its
Cache-Controladd_header overrides inherited ones. /.well-known/security.txtis answered by nginx itself, so it doesn't rely on the Docusaurus build copying dot-files.absolute_redirect offemits a relativeLocationso redirects keep the client on https.server_tokens offdrops the nginx version from theServerheader and error pages.