server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; # gzip gzip on; gzip_vary on; gzip_types text/css application/javascript application/json image/svg+xml text/plain; gzip_min_length 512; # index.html: never cache (so welcome screen / wiring updates land instantly) location = /index.html { add_header Cache-Control "no-store, must-revalidate" always; } # static assets: cache 1h location ~* \.(?:css|js|json|svg|png|jpe?g|webp|gif|ico|woff2?)$ { add_header Cache-Control "public, max-age=3600" always; try_files $uri =404; } location / { try_files $uri $uri/ /index.html; } }