server { listen 80; server_name _; root /app; index index.html; # GZIP Compression gzip on; gzip_vary on; gzip_proxied any; gzip_comp_level 6; gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml font/woff2; # Browser Caching location ~* \.(jpg|jpeg|png|gif|webp|svg|ico|cur|gz|svgz|mp4|ogg|ogv|webm|htc)$ { expires 1y; access_log off; add_header Cache-Control "public, max-age=31536000, immutable"; } location ~* \.(css|js)$ { expires 1M; access_log off; add_header Cache-Control "public, max-age=2592000, immutable"; } location ~* \.(woff|woff2|ttf|otf|eot)$ { expires 1y; access_log off; add_header Cache-Control "public, max-age=31536000, immutable"; } # HTML - No cache location ~* \.(html|htm)$ { expires 1h; add_header Cache-Control "public, max-age=3600, must-revalidate"; } error_page 404 /404.html; location = /404.html { internal; } }