fix: 优化构建速度,后端容器名
All checks were successful
Web UI CI/CD / build-and-deploy (push) Successful in 3m31s

This commit is contained in:
lzh
2025-12-18 14:03:54 +08:00
parent 1c04ff0d7b
commit 874c06fa51
3 changed files with 21 additions and 6 deletions

View File

@@ -14,10 +14,21 @@ server {
index index.html;
# API 反向代理到后端服务
# 如果后端在 Docker 容器中,使用容器名http://aiot-server:48080
# 如果后端在宿主机上,使用内网地址http://172.17.16.14:48080 或 http://172.17.0.1:48080
# 后端服务在 Docker 容器中,使用容器名访问(都在 aiot-net 网络中)
# 如果后端在宿主机上,改为http://172.17.0.1:48080/admin-api
location /admin-api {
proxy_pass http://172.17.16.14:48080/admin-api;
# 后端服务地址(根据实际情况选择)
# 方案1后端在 Docker 容器中(推荐)
proxy_pass http://aiot-server:48080/admin-api;
# 方案2后端在宿主机上取消注释下面这行并注释掉上面那行
# proxy_pass http://172.17.0.1:48080/admin-api;
# 代理超时设置
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
# 代理请求头
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;