feat(deploy): 挂载 web/public 与 web/promotion 到 yh_web,支持热更新无需重建 dist

Made-with: Cursor
This commit is contained in:
whm
2026-03-22 00:58:19 +08:00
parent 122f5b8fba
commit 66b873d0b0
4 changed files with 28 additions and 3 deletions

View File

@@ -15,6 +15,16 @@ server {
add_header Cache-Control "public, immutable";
}
# web/public 挂载 /var/www/yh-public单段文件名同 dist 根 URL优先挂载后回退 dist
location ~ ^/([^/]+\.(?:png|jpe?g|gif|ico|svg|webp|webmanifest))$ {
root /var/www/yh-public;
try_files /$1 @dist_root_public;
}
location @dist_root_public {
root /usr/share/nginx/html;
try_files $uri =404;
}
location ^~ /promotion/ {
try_files $uri =404;
add_header Cache-Control "public, max-age=86400";