fix(ci): nginx index.html 不缓存,防止部署后白屏
deploy-test / build-and-deploy-test (push) Successful in 3m43s

This commit is contained in:
abcv7
2026-08-27 10:23:43 +08:00
parent 4b538f613c
commit 427d4878c7
+12 -6
View File
@@ -124,6 +124,18 @@ jobs:
gzip_types text/plain text/css application/json application/javascript text/xml image/svg+xml; gzip_types text/plain text/css application/json application/javascript text/xml image/svg+xml;
gzip_min_length 256; gzip_min_length 256;
# 管理后台入口文件不缓存
location = /admin/index.html {
alias /usr/share/nginx/html/admin/index.html;
add_header Cache-Control "no-cache, must-revalidate";
}
# 管理后台 (Vue3 SPA)
location /admin/ {
alias /usr/share/nginx/html/admin/;
try_files $uri $uri/ /admin/index.html;
}
# 后端 SDK 静态文件 # 后端 SDK 静态文件
location /tac/ { location /tac/ {
root /usr/share/nginx/html; root /usr/share/nginx/html;
@@ -139,12 +151,6 @@ jobs:
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
} }
# 管理后台 (Vue3 SPA)
location /admin/ {
alias /usr/share/nginx/html/admin/;
try_files $uri $uri/ /admin/index.html;
}
# 管理后台 API 反代 # 管理后台 API 反代
location ^~ /admin/api/ { location ^~ /admin/api/ {
proxy_pass http://tianai-captcha:18200/api/; proxy_pass http://tianai-captcha:18200/api/;