server { listen 3000; server_name localhost; root /usr/share/nginx/html; index index.html; # Gzip Compression gzip on; gzip_vary on; gzip_min_length 1024; gzip_proxied expired no-cache no-store private auth; gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml application/json image/svg+xml; # Cache control for static assets location ~* \.(?:css|js|jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ { expires 1y; access_log off; add_header Cache-Control "public"; } # Disable caching for appsettings.json so changes take effect immediately location = /appsettings.json { expires -1; add_header Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"; } # HTML5 SPA History Mode Support location / { try_files $uri $uri/ /index.html; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } }