server { listen 80; root /usr/share/nginx/html; index index.html; # Gzip voor statische assets gzip on; gzip_types text/plain text/css application/json application/javascript text/xml application/xml image/svg+xml; # Cache-control: assets met hash in naam → lang; index.html → nooit location ~* \.(js|css|woff2?|ttf|eot|svg|png|jpg|ico|webp)$ { expires 1y; add_header Cache-Control "public, immutable"; try_files $uri =404; } # SPA fallback – stuur alle routes naar index.html location / { try_files $uri $uri/ /index.html; add_header Cache-Control "no-store, no-cache, must-revalidate"; } }