Files
2026-04-04 11:01:11 +09:00

46 lines
786 B
Plaintext

server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_min_length 1024;
gzip_comp_level 5;
gzip_types
text/plain
text/css
application/javascript
application/json
application/xml
image/svg+xml
application/manifest+json;
# Static asset caching
location /assets/ {
expires 30d;
add_header Cache-Control "public, immutable";
try_files $uri =404;
}
location = /index.html {
add_header Cache-Control "no-cache";
}
location = /sw.js {
add_header Cache-Control "no-cache";
}
location = /manifest.webmanifest {
add_header Cache-Control "no-cache";
}
# SPA fallback
location / {
try_files $uri $uri/ /index.html;
}
}