diff --git a/nginx.conf.gateway b/nginx.conf.gateway index 10d1db8..23e2f8a 100644 --- a/nginx.conf.gateway +++ b/nginx.conf.gateway @@ -123,6 +123,17 @@ http { proxy_redirect https://sys_api/ http://$host:$server_port/auth/; } + location = /auth/.well-known/openid-configuration { + proxy_pass https://sys_api/.well-known/openid-configuration; + + # 动态修改返回的JSON中的URL + proxy_set_header Accept-Encoding ""; + sub_filter_types application/json; + sub_filter_once off; + sub_filter '"issuer":"' '"issuer":"https://$host:8001"'; + sub_filter 'https://sys-api:19902' 'https://$host:8001'; + sub_filter 'https://sys_api' 'https://$host:8001'; + } # UI前端路由 location / { proxy_pass http://sys_ui; @@ -175,7 +186,17 @@ http { proxy_redirect https://sys_api:19902/ http://$host:$server_port/auth/; proxy_redirect https://sys_api/ http://$host:$server_port/auth/; } - + location = /auth/.well-known/openid-configuration { + proxy_pass https://sys_api/.well-known/openid-configuration; + + # 动态修改返回的JSON中的URL + proxy_set_header Accept-Encoding ""; + sub_filter_types application/json; + sub_filter_once off; + sub_filter '"issuer":"' '"issuer":"https://$host:8001"'; + sub_filter 'https://sys-api:19902' 'https://$host:8001'; + sub_filter 'https://sys_api' 'https://$host:8001'; + } location /api/sys/ { proxy_pass https://sys_api/api/; proxy_ssl_server_name on;