36 行
1.1 KiB
Plaintext
36 行
1.1 KiB
Plaintext
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
root /usr/share/nginx/html/tenant;
|
|
index index.html;
|
|
|
|
# Vite 哈希资源属于不可变内容。独立 location 必须返回真实 404,禁止回退到
|
|
# index.html,否则 chunk 丢失会被伪装成 MIME/语法错误。
|
|
location ~* ^/(?:releases/[^/]+/assets|assets)/ {
|
|
try_files $uri =404;
|
|
add_header Cache-Control "public, max-age=31536000, immutable" always;
|
|
}
|
|
|
|
location ~* ^/docs/(?:releases/[^/]+/assets|assets)/ {
|
|
root /usr/share/nginx/html;
|
|
try_files $uri =404;
|
|
add_header Cache-Control "public, max-age=31536000, immutable" always;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
add_header Cache-Control "no-cache, no-store, must-revalidate" always;
|
|
add_header Pragma "no-cache" always;
|
|
add_header Expires "0" always;
|
|
}
|
|
|
|
location /docs/ {
|
|
alias /usr/share/nginx/html/docs/;
|
|
try_files $uri $uri/ /docs/index.html;
|
|
add_header Cache-Control "no-cache, no-store, must-revalidate" always;
|
|
add_header Pragma "no-cache" always;
|
|
add_header Expires "0" always;
|
|
}
|
|
}
|