server { listen 3000; root /usr/share/nginx/html; index index.html; # Every redirect this file can emit (the trailing-slash canonicaliser # below, plus nginx's own built-in directory redirects) must be a bare # path, not an absolute URL. With the default `absolute_redirect on`, # nginx reconstructs the origin from its own `listen` port and answers # a request for https://demo.cairnobs.org/settings/ with # `Location: http://127.0.0.1:3000/settings` -- the container's # internal address, unreachable from the client, and a downgrade to # http on top of it. Verified by curl against the built image, and # latent in this file before the redirect below existed too, via the # directory redirect on /dev. absolute_redirect off; # Security-audit remediation (M-3): baseline browser security headers, # absent entirely before this. HSTS/nosniff/frame-options/referrer- # policy/permissions-policy carry no functional risk to this app and # are unconditionally safe to add. # # CSP is the one directive that needed real care rather than a # copy-pasted strict default: adapter-static's own build output # (web/build/index.html) genuinely contains two inline