# Static single-page site. No SPA fallback — unknown paths 404, matching the # old Workers-assets behaviour. server { listen 80; server_name _; root /usr/share/nginx/html; gzip on; gzip_min_length 1024; gzip_types text/css application/javascript application/json image/svg+xml application/pdf; # CSS is inlined in the HTML precisely so nothing can drift in caches, so # the page itself must always revalidate. Explicit max-age rather than # bare no-cache so Cloudflare's edge passes it through instead of # substituting its own browser TTL. location = /index.html { add_header Cache-Control "public, max-age=0, must-revalidate"; } location = / { add_header Cache-Control "public, max-age=0, must-revalidate"; } # Unhashed but rarely-changing assets: a day in cache, then revalidate. location ~* \.(svg|ico|png|pdf|txt)$ { add_header Cache-Control "public, max-age=86400"; } }