server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; client_max_body_size 30m; add_header X-Frame-Options "SAMEORIGIN" always; add_header X-Content-Type-Options "nosniff" always; add_header X-XSS-Protection "1; mode=block" always; add_header Referrer-Policy "strict-origin-when-cross-origin" always; # CSP — allows Anthropic API calls and Google Fonts add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: blob:; connect-src 'self' https://api.anthropic.com; worker-src blob:;" always; gzip on; gzip_types text/html text/css application/javascript application/json; gzip_min_length 1024; location /health { access_log off; return 200 "ok\n"; add_header Content-Type text/plain; } location /api/ { resolver 127.0.0.11 valid=10s; set $backend "http://rongorongo-api:8000"; proxy_pass $backend; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_request_buffering off; proxy_read_timeout 60s; } location / { try_files $uri $uri/ /index.html; expires -1; add_header Cache-Control "no-store, no-cache, must-revalidate"; } location ~* \.(js|css|png|jpg|jpeg|gif|ico|woff2)$ { expires 1y; add_header Cache-Control "public, immutable"; } }