chore(compose): web 仅保留 public 挂载,推广走 dist/API;验证仅 yh_nginx
Made-with: Cursor
This commit is contained in:
@@ -4,13 +4,7 @@ server {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
# 域名/微信等验证文件:用 root+URI,勿用「正则 + alias $1」(易 403);文件放宿主机 ./verify-root/
|
||||
location ~ ^/[A-Za-z0-9._-]+\.(txt|html|xml)$ {
|
||||
root /verify-root;
|
||||
try_files $uri =404;
|
||||
default_type text/plain;
|
||||
add_header Cache-Control "no-store";
|
||||
}
|
||||
# 域名/微信等验证文件:由外层 yh_nginx(443)直接 root /verify-root 提供,本容器不再挂载 verify-root
|
||||
|
||||
# 静态资源必须真实存在,避免错误回退成 index.html 导致白屏
|
||||
location ^~ /assets/ {
|
||||
@@ -47,8 +41,7 @@ server {
|
||||
add_header Cache-Control "public, max-age=604800";
|
||||
}
|
||||
|
||||
# 推广素材:含视频/封面等大文件,浏览器可长期缓存减轻二次访问流量
|
||||
# 宿主机 ./web/promotion 挂载覆盖本路径,改素材后依赖 max-age 到期或用户强刷
|
||||
# 推广素材:来自构建产物 deploy/web/dist/promotion(pull-and-restart 从 web/promotion rsync);后台上传走 /api/web/.../promotion-media/
|
||||
location ^~ /promotion/ {
|
||||
try_files $uri =404;
|
||||
expires 7d;
|
||||
|
||||
Reference in New Issue
Block a user