调整路由代码

This commit is contained in:
易栋梁 2025-06-29 14:30:44 +08:00
parent 65afb933c9
commit f68e5df0bc
1 changed files with 8 additions and 3 deletions

View File

@ -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/;
}
}