feat(deploy): 挂载 web/public 与 web/promotion 到 yh_web,支持热更新无需重建 dist
Made-with: Cursor
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user