server { listen 80; root /usr/share/nginx/html; # Hashed bundles never change — cache for a year; index.html — always fresh location ~* \.(js|css|woff2?|ico|png|svg)$ { expires 1y; add_header Cache-Control "public, immutable"; try_files $uri =404; } location / { add_header Cache-Control "no-cache"; try_files $uri $uri/ /index.html; } gzip on; gzip_types text/css application/javascript image/svg+xml; }