fix(deploy): ???????? Nginx ???????

Made-with: Cursor
This commit is contained in:
whm
2026-03-27 12:04:22 +08:00
parent 0980d1fa9c
commit 89cc1d2368
4 changed files with 44 additions and 34 deletions

View File

@@ -85,11 +85,12 @@ sudo systemctl start nginx
逻辑由 **`scripts/lib-yh-compose-deploy.sh`** 统一处理(无需单独启动脚本):
1. **启动前**`docker compose … down --remove-orphans`,只停本项目容器,**不**宿主机 `nginx``start/stop`
2. **`systemctl` 显示宿主机 Nginx 已运行**:只起 `mongo api web admin`**不起**容器 `yh_nginx`**`nginx/yuheng.host.conf`** 生成 `/etc/nginx/conf.d/<域名>.conf` **`nginx -t` + `reload`**(不重载则无法指向新回环端口)
3. **宿主机 Nginx 未运行**起完整栈(**`--profile compose-internal-nginx`**,含容器 `yh_nginx` 终止 TLS
4. **证书**同上,`/etc/ssl/yh_web/yuheng.yuxindazhineng.com/``pull-and-restart.sh` / `restart.sh` 仍会同步仓库内证书到该目录
1. **启动前**`docker compose … down --remove-orphans`,只停本项目容器,**不停止**宿主机 `nginx`
2. **写入宿主机站点配置****`nginx/yuheng.host.conf`** 生成 `/etc/nginx/conf.d/<域名>.conf`,并执行 **`nginx -t`**
3. **检测宿主机 Nginx**若在线则跳过;若不在线则执行 `systemctl start nginx``enable`
4. **启动容器**只起 `mongo api web admin`(不再启动容器 `yh_nginx`
5. **证书**:同上,`/etc/ssl/yh_web/yuheng.yuxindazhineng.com/``pull-and-restart.sh` / `restart.sh` 仍会同步仓库内证书到该目录。
**回环端口**(与 `nginx/yuheng.host.conf` 一致API `127.0.0.1:8088`,前台 `9080`,后台 `9081`
**与「方式 B8443**:方式 B 是宿主机 → 容器 Nginx → 各服务;本节是宿主机 → 各服务,**一层**
**说明**:不再使用容器 `yh_nginx` 作为入口,统一为宿主机 Nginx 单入口方案