From 2f81f21e4228c343f90807d97381c53879766f76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E5=8B=A4=E6=B0=91?= Date: Wed, 20 May 2026 16:35:27 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E6=9E=B6=E6=9E=84?= =?UTF-8?q?=E5=9B=BE=E5=92=8C=20nginx=20=E9=85=8D=E7=BD=AE=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E8=87=B3=E5=8D=95=E5=85=A5=E5=8F=A3=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit README 架构图改为内置 nginx 容器作为统一入口(端口 11223), 服务表移除 nginx-bundled(可选)改为 nginx 列入 base, 注意事项更新为 proxy_pass 127.0.0.1:11223。 configuration.md 将"内置 nginx(可选)"更正为必启服务。 Co-Authored-By: Claude Sonnet 4.6 --- README.md | 26 ++++++++++++++------------ docs/configuration.md | 13 +++---------- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 4eb697b..0180329 100644 --- a/README.md +++ b/README.md @@ -16,17 +16,19 @@ curl -fsSL https://xuqinmin.com/xuqmGroup/XuqmGroup-PrivateDeploy/raw/branch/mai ``` 用户 nginx(宿主机) │ - ├── 127.0.0.1:11224 tenant-service /api/ /actuator/ - ├── 127.0.0.1:11225 file-service /file/ - ├── 127.0.0.1:11226 tenant-web / - ├── 127.0.0.1:11227 ops-web /ops - ├── 127.0.0.1:11228 im-service /api/im/ /ws/im - ├── 127.0.0.1:11229 update-service /api/v1/updates/ /api/v1/rn/ - ├── 127.0.0.1:11230 license-service /api/license/ - └── 127.0.0.1:11231 push-service (厂商回调,按需) + └── 127.0.0.1:11223 内置 nginx 容器(统一入口) + │ + ├── tenant-service /api/ /actuator/ + ├── file-service /file/ + ├── tenant-web /(兜底) + ├── ops-web /ops + ├── im-service /api/im/ /ws/im + ├── update-service /api/v1/updates/ /api/v1/rn/ + ├── license-service /api/license/ + └── push-service (厂商回调,按需) ``` -各服务仅绑定 `127.0.0.1`,外部无法直接访问,只有宿主机 nginx 能代理进去。 +内置 nginx 容器属于 `base` 必启服务,对外只暴露 `127.0.0.1:11223`。宿主机 nginx 只需一条 `proxy_pass` 指向该端口,内部路由由容器负责。各业务容器(11224–11231)仍绑定宿主机以便直接调试,正常流量全部走 11223。 ## 租户初始化方式 @@ -39,14 +41,13 @@ curl -fsSL https://xuqinmin.com/xuqmGroup/XuqmGroup-PrivateDeploy/raw/branch/mai | Profile | 服务 | 说明 | |---------|------|------| -| base | tenant-service, file-service, tenant-web, ops-web | 必选核心服务 | +| base | tenant-service, file-service, tenant-web, ops-web, nginx | 必选核心服务(含内置路由 nginx) | | infra-mysql | mysql | 托管数据库 | | infra-redis | redis | 托管缓存 | | im | im-service | IM HTTP + WebSocket | | push | push-service | 厂商推送 | | update | update-service | 版本管理 + RN 热更新 | | license | license-service | License 校验 | -| nginx-bundled | nginx | 内置 nginx(默认不启动,用户有宿主机 nginx 时不需要) | ## 后期启用/禁用服务 @@ -58,7 +59,8 @@ curl -fsSL https://xuqinmin.com/xuqmGroup/XuqmGroup-PrivateDeploy/raw/branch/mai ## 注意事项 - `application.yml` 中数据库 URL 硬编码了生产地址,`docker-compose.yml` 的 `environment:` 节负责覆盖,**不能删除** -- 所有容器绑定 `127.0.0.1`,nginx 中 `proxy_pass` 必须写 `127.0.0.1:1122x`,不能写 `localhost`(部分系统 localhost 解析为 IPv6) +- 宿主机 nginx `proxy_pass` 写 `http://127.0.0.1:11223`,同时须透传 `Upgrade` / `Connection` 头(WebSocket 必需),详见 [docs/runbook.md](docs/runbook.md) +- 不能写 `localhost`,部分系统 localhost 解析为 IPv6 ## 文档 diff --git a/docs/configuration.md b/docs/configuration.md index 7d15044..8028db8 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -80,7 +80,7 @@ environment: | 11230 | license-service | 8085 | `/api/license/` | | 11231 | push-service | 8083 | 厂商回调(按需) | -所有端口绑定 `127.0.0.1`,nginx 需写 `proxy_pass http://127.0.0.1:1122x`。 +所有端口绑定 `127.0.0.1`,11224–11231 仅用于直接调试。宿主机 nginx 代理到内置 nginx 端口 11223,详见 [runbook.md](runbook.md)。 ## 容器内部通信 @@ -97,16 +97,9 @@ SDK_TENANT_SERVICE_URL: "http://tenant-service:9001" `docker-compose.yml` 已包含上述配置,不需要手动修改。 -## 内置 nginx(可选) +## 内置 nginx -`nginx-bundled` profile 提供内置 nginx 容器,默认不启动。通常用宿主机自己的 nginx 代理到各服务端口。需要内置 nginx 时: - -```env -# .env -COMPOSE_PROFILES=base,infra-mysql,infra-redis,im,push,update,license,nginx-bundled -``` - -内置 nginx 绑定宿主机 80/443 端口,与宿主机已有 nginx 冲突时不可同时使用。 +nginx 容器属于 `base` 必启服务,绑定 `127.0.0.1:11223`,统一处理所有内部路由(按 Docker 服务名转发,无需关心各服务端口)。宿主机 nginx 只需一条 `proxy_pass http://127.0.0.1:11223` 加 WebSocket 透传头,配置见 [runbook.md](runbook.md#nginx-配置)。 ## `config/vendors/`