main
kangwenjing 2026-09-08 17:10:24 +08:00
parent 2cb67fb291
commit 641acd8c9d
1 changed files with 0 additions and 14 deletions

View File

@ -7,20 +7,6 @@ server {
resolver ${RESOLVER} valid=30s ipv6=off;
# 静态资源:命中直接返回文件并长时间缓存;缺失返回 404绝不回退成 HTML
# 避免 CDN/网关把误回退的 index.html 当资源缓存造成 MIME 报错。
location /assets/ {
try_files $uri =404;
expires 1y;
add_header Cache-Control "public, max-age=31536000, immutable";
access_log off;
}
# index.html 不缓存,保证每次回源拿到最新 hash 引用。
location = /index.html {
add_header Cache-Control "no-cache";
}
location / {
try_files $uri $uri/ /index.html;
}