server { listen 80; root /usr/share/nginx/html; index index.html; # SPA fallback — serve index.html for all routes that don't match a file. location / { try_files $uri $uri/ /index.html; } # Runtime config generated by the entrypoint — don't cache. location = /config.json { add_header Cache-Control "no-cache"; } # OAuth client metadata must be fetchable cross-origin by auth servers. location = /client-metadata.json { add_header Access-Control-Allow-Origin *; add_header Cache-Control "public, max-age=300"; } # Security headers (mirrors public/_headers for Cloudflare Pages). add_header X-Frame-Options DENY; add_header X-Content-Type-Options nosniff; add_header Referrer-Policy strict-origin-when-cross-origin; add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https:; connect-src 'self' https:; frame-ancestors 'none'; base-uri 'self'; form-action 'self'"; }