fix: 优化构建速度,后端容器名
All checks were successful
Web UI CI/CD / build-and-deploy (push) Successful in 3m31s
All checks were successful
Web UI CI/CD / build-and-deploy (push) Successful in 3m31s
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user