Parcourir la source

fix: 排除/auth/callback从nginx代理到后端

SSO回调页面应由前端SPA处理,不应代理到后端
添加location /auth/callback规则使用try_files处理
kinglee il y a 1 semaine
Parent
commit
6dbbe9fd49
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 5 0
      nginx.conf.template

+ 5 - 0
nginx.conf.template

@@ -7,6 +7,11 @@ server {
         try_files $uri $uri/ /index.html;
         try_files $uri $uri/ /index.html;
     }
     }
 
 
+    # SSO 回调页面由前端 SPA 处理,不代理到后端
+    location /auth/callback {
+        try_files $uri /index.html;
+    }
+
     location ~ ^/(v1|v2|auth|version|proxy|update|cli|grafana) {
     location ~ ^/(v1|v2|auth|version|proxy|update|cli|grafana) {
         proxy_pass ${BACKEND_URL};
         proxy_pass ${BACKEND_URL};
         proxy_set_header Host $host;
         proxy_set_header Host $host;