server { # 80 is the primary port; 3000 is also accepted so platform port # settings that default to 3000 (e.g. Coolify) work unchanged. listen 80; listen 3000; server_name _; root /usr/share/nginx/html; index index.html; # Never emit the nginx version server_tokens off; # Gzip text assets gzip on; gzip_types text/plain text/css application/javascript application/json image/svg+xml; gzip_min_length 1024; # SPA fallback: /privacy, /terms and any unknown route serve index.html location / { try_files $uri $uri/ /index.html; } # Hashed build assets can be cached hard location /assets/ { add_header Cache-Control "public, max-age=31536000, immutable"; try_files $uri =404; } # Favicon and static files location ~* \.(svg|ico|png|jpg|jpeg|webp|txt|xml|webmanifest)$ { expires 7d; add_header Cache-Control "public"; try_files $uri =404; } }