27 lines
662 B
Nginx Configuration File
27 lines
662 B
Nginx Configuration File
|
|
server {
|
|||
|
|
listen 80;
|
|||
|
|
root /usr/share/nginx/html;
|
|||
|
|
index index.html;
|
|||
|
|
|
|||
|
|
# Gzip
|
|||
|
|
gzip on;
|
|||
|
|
gzip_types text/plain text/css application/javascript application/json image/svg+xml;
|
|||
|
|
|
|||
|
|
# PWA – all routes fall back to index.html
|
|||
|
|
location / {
|
|||
|
|
try_files $uri $uri/ /index.html;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
# Cache hashed assets aggressively
|
|||
|
|
location ~* \.(js|css|woff2|png|ico|svg)$ {
|
|||
|
|
expires 1y;
|
|||
|
|
add_header Cache-Control "public, immutable";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
# Never cache the service worker or manifest
|
|||
|
|
location ~* (service-worker\.js|manifest\.webmanifest)$ {
|
|||
|
|
expires off;
|
|||
|
|
add_header Cache-Control "no-store";
|
|||
|
|
}
|
|||
|
|
}
|