workshopclaudecode/nginx.conf

32 lines
906 B
Nginx Configuration File
Raw Permalink Normal View History

server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Gzip voor tekstuele assets
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml;
# Cache hashed assets uit de Vite build (bestandsnaam bevat hash)
location /assets/ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# SPA fallback: stuur alle onbekende routes naar index.html
# zodat React Router de routes /bedankt, /inschrijven etc. afhandelt
location / {
try_files $uri $uri/ /index.html;
}
# index.html zelf nooit cachen, anders zie je geen nieuwe deploys
location = /index.html {
add_header Cache-Control "no-cache, no-store, must-revalidate";
expires 0;
}
}