puffin-app/nginx.conf
2025-05-13 19:02:08 +02:00

37 lines
1.0 KiB
Nginx Configuration File

server {
listen 3800; # Changed to port 3800 to match external Nginx config
server_name localhost;
# Root directory for static files
root /usr/share/nginx/html;
index index.html;
# Enable gzip compression
gzip on;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
# Forward all requests to index.html for SPA routing
location / {
try_files $uri $uri/ /index.html;
}
# Cache static assets
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
expires 30d;
add_header Cache-Control "public, no-transform";
}
# Don't cache HTML
location ~* \.html$ {
expires -1;
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate";
}
# Error handling
error_page 404 /index.html;
error_page 500 502 503 504 /index.html;
}