2026-04-29-nrc4 #1

Merged
qiaoxinjiu merged 8 commits from 2026-04-29-nrc4 into master 2026-05-08 11:29:01 +08:00
Showing only changes of commit 52b0c2cafb - Show all commits

View File

@@ -1,3 +1,8 @@
# 前端静态站点:发版后让用户尽快拿到新版本
# — index.html 禁止缓存(每次拉最新入口,里面的 script/link 会指向新的 hash 资源)
# — /static/ 下 Webpack 带 chunkhash/contenthash 的文件可长期缓存(文件名变 = 新文件)
# 仍需每次发版:重新 build、把新 dist 部署到本 root或重建/更新镜像并重启容器)
server {
listen 80;
server_name localhost;
@@ -5,6 +10,19 @@ server {
root /usr/share/nginx/html;
index index.html;
# 入口页:不缓存,避免一直用旧的 index 引用旧 js/css
location = /index.html {
add_header Cache-Control "no-store, no-cache, must-revalidate, max-age=0" always;
add_header Pragma "no-cache" always;
}
# Webpack 产物:文件名含 hash可安全长期缓存
location ^~ /static/ {
expires 1y;
add_header Cache-Control "public, immutable" always;
access_log off;
}
location /it/api/ {
proxy_pass http://172.18.0.1:5010;
proxy_set_header Host $host;