diff --git a/nginx.conf b/nginx.conf index 0daa0c9..887693e 100644 --- a/nginx.conf +++ b/nginx.conf @@ -15,28 +15,31 @@ server { try_files $uri $uri/ /index.html; } - # API 代理到后端 + # API 代理到后端(直接访问宿主机上的后端服务) location /api/ { - proxy_pass http://martial-backend:8123/api/; + proxy_pass http://172.21.0.1:8123/api/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } - - # BladeX 系统模块代理 + + # BladeX 认证模块代理 location /blade-auth/ { - proxy_pass http://martial-backend:8123/blade-auth/; + proxy_pass http://172.21.0.1:8123/blade-auth/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; } - + + # BladeX 系统模块代理 location /blade-system/ { - proxy_pass http://martial-backend:8123/blade-system/; + proxy_pass http://172.21.0.1:8123/blade-system/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; } # 缓存静态资源