mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
34 lines
913 B
Nginx Configuration File
34 lines
913 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# SPA fallback — all unknown paths go to index.html
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# pdfjs-dist ships its worker as an ES module. Firefox rejects a module
|
|
# worker when nginx falls back to application/octet-stream for .mjs.
|
|
location ~* \.mjs$ {
|
|
types {
|
|
application/javascript mjs;
|
|
}
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
|
|
# Cache hashed assets aggressively
|
|
location ~* \.(js|css|woff2?|ttf|svg|ico|png|jpg|jpeg|webp|gif)$ {
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
|
|
# No caching for index.html so users always get the latest shell
|
|
location = /index.html {
|
|
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
|
}
|
|
}
|