From f68e5df0bccf9f161001b4893c5b637bf81619e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=93=E6=A0=8B=E6=A2=81?= Date: Sun, 29 Jun 2025 14:30:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=B7=AF=E7=94=B1=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nginx.conf.gateway | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/nginx.conf.gateway b/nginx.conf.gateway index f8b04ed..23b50d6 100644 --- a/nginx.conf.gateway +++ b/nginx.conf.gateway @@ -94,7 +94,7 @@ http { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 关键 4: 重写后端返回的 Location 头(解决重定向端口丢失) - proxy_redirect https://sys_api/ https://$host:$server_port/auth/; + proxy_redirect https://sys-api:19902/ https://$host:$server_port/auth/; } location /connect/ { @@ -114,7 +114,7 @@ http { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_redirect https://sys_api/connect/ https://$host:$server_port/connect/; + proxy_redirect https://sys-api:19902/connect/ https://$host:$server_port/connect/; } location /Account/ { @@ -134,7 +134,7 @@ http { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_redirect https://sys_api/Account/ https://$host:$server_port/Account/; + proxy_redirect https://sys-api:19902/Account/ https://$host:$server_port/Account/; } @@ -145,6 +145,7 @@ http { proxy_ssl_session_reuse off; proxy_ssl_verify off; proxy_set_header Authorization $http_authorization; # 传递 Authorization 头 + proxy_redirect http://sys-api:19903/ https://$host:$server_port/; } # 3. Lmg API 路由 location /api/lmg/ { @@ -153,6 +154,7 @@ http { proxy_ssl_session_reuse off; proxy_ssl_verify off; proxy_set_header Authorization $http_authorization; # 传递 Authorization 头 + proxy_redirect http://lmg-api:19903/ https://$host:$server_port/; } # 4. Lmg UI 路由 @@ -160,6 +162,7 @@ http { location /lmg/ { # 将 /lmg/path -> http://lmg_ui/path proxy_pass http://lmg_ui/; + proxy_redirect http://lmg_ui/ https://$host:$server_port/; } # 6. OAuth 回调地址路由 @@ -167,6 +170,7 @@ http { location = /Callback { # 将 /Callback -> http://sys_ui/Callback proxy_pass http://sys_ui; + proxy_redirect http://sys_ui/ https://$host:$server_port/; } # 5. Sys UI 和根路径路由 # IMPORTANT: sys-ui 的前端路由基础路径(base path)需要配置为 / @@ -175,6 +179,7 @@ http { # 根路径 / 直接访问 sys_ui # 将 /path -> http://sys_ui/path proxy_pass http://sys_ui; + proxy_redirect http://sys_ui/ https://$host:$server_port/; } }