From 71a4cddf0b008e740b2f63b8b68d82f24bdc8a3d Mon Sep 17 00:00:00 2001 From: wangjia <809946525@qq.com> Date: Tue, 16 Jun 2026 08:37:55 +0800 Subject: [PATCH] =?UTF-8?q?sync(edge):=20jiu.conf=20=E5=8F=8D=E5=90=91?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E7=BA=BF=E4=B8=8A=E7=89=88=E6=9C=AC(OG=20?= =?UTF-8?q?=E6=B3=A8=E5=85=A5=20+=20/downloads=20+=20/app/product=20?= =?UTF-8?q?=E9=87=8D=E5=86=99)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit EC2 上的 jiu.conf 早于本次已含商品页反代后端注入微信 OG 标签、 /app/product 重写、/downloads 安装包下载,但从未同步回仓库。 本次以线上为准回灌,避免下次 deploy.sh 用旧版覆盖线上配置。 Co-Authored-By: Claude Opus 4.8 --- deploy/edge/conf.d/jiu.conf | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/deploy/edge/conf.d/jiu.conf b/deploy/edge/conf.d/jiu.conf index 07105c3..5f5d245 100644 --- a/deploy/edge/conf.d/jiu.conf +++ b/deploy/edge/conf.d/jiu.conf @@ -47,16 +47,30 @@ server { expires 0; } - # 公开商品详情页(扫码跳转)→ 交给 Flutter Web 路由处理 + # 公开商品详情页(扫码跳转)→ 后端注入 OG 标签后返回 Flutter index.html location ~ ^/product/ { - root /opt/jiu/web; - try_files $uri /app/index.html; + proxy_pass http://127.0.0.1:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_read_timeout 30s; } - # 扫码页(/scan/ → scan.html,JS 从 URL 读取 id) - location /scan/ { - root /opt/jiu/marketing; - try_files /scan.html =404; + # Flutter 路由会把 /product/:id 重写为 /app/product/:id(base-href=/app/) + # 分享此 URL 时微信爬虫也需要 OG 标签 → 去掉 /app 前缀后转发后端 + location ~ ^/app/product/ { + rewrite ^/app(/product/.+)$ $1 break; + proxy_pass http://127.0.0.1:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_read_timeout 30s; + } + + # 桌面客户端安装包下载(Windows .exe / macOS .zip) + location /downloads/ { + alias /opt/jiu/downloads/; + add_header Content-Disposition "attachment"; + add_header Cache-Control "no-cache"; + autoindex off; } # 营销站点兜底(根路径及所有其他路径)