fix(deploy): ???????? Nginx ???????
Made-with: Cursor
This commit is contained in:
@@ -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`。
|
||||
|
||||
**与「方式 B(8443)」**:方式 B 是宿主机 → 容器 Nginx → 各服务;本节是宿主机 → 各服务,**一层**。
|
||||
**说明**:不再使用容器 `yh_nginx` 作为入口,统一为宿主机 Nginx 单入口方案。
|
||||
|
||||
Reference in New Issue
Block a user