From 97c0f05b2d6223048e467931ced69c7d1e1b1f15 Mon Sep 17 00:00:00 2001 From: milky0217 Date: Sat, 30 May 2026 09:31:19 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E8=93=9D=E7=BB=BF=E9=83=A8=E7=BD=B2-?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=9F=9F=E5=90=8D=E8=AE=BF=E9=97=AE=E8=AF=B4?= =?UTF-8?q?=E6=98=8E(=E5=9F=9F=E5=90=8D=E4=B8=8D=E5=8F=98=E4=BB=85proxy=5F?= =?UTF-8?q?pass=E5=88=87=E6=8D=A2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/BLUE-GREEN-DEPLOY.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/BLUE-GREEN-DEPLOY.md b/docs/BLUE-GREEN-DEPLOY.md index d7de3b6..fe2126c 100644 --- a/docs/BLUE-GREEN-DEPLOY.md +++ b/docs/BLUE-GREEN-DEPLOY.md @@ -47,6 +47,25 @@ 任何时候只有一个实例接收流量,另一个运行旧版本待命。 +## 域名与蓝绿的关系 + +蓝绿部署**不改变域名访问方式**,域名始终指向同一 OpenResty 实例: + +``` +用户访问 OpenResty(域名不变) 后端实例 +dev.xmclassmate.top ──→ dev.xmclassmate.top ──→ :8080(蓝)或 :8081(绿) +xmclassmate.top ──→ xmclassmate.top ──→ :4433(蓝)或 :4434(绿) +``` + +切换时 OpenResty 内部的 `proxy_pass` 指向的目标端口变更,**用户无感知**: + +``` +切换前:dev.xmclassmate.top ──→ proxy_pass 127.0.0.1:8080 ← 蓝色活动 +切换后:dev.xmclassmate.top ──→ proxy_pass 127.0.0.1:8081 ← 绿色活动 +``` + +小程序前端的 `env.ts` 中 `CURRENT_ENV` 指向的域名(`dev.xmclassmate.top` 或 `xmclassmate.top`)**无需修改**。 + ## 组件变更 ### 新增 systemd service