gateway 与 spring-security 登陆重定向问题
来源:10-2 Spring Cloud Gateway是什么?优缺点分析

破地瓜
2020-05-08
所有服务均部署在阿里云服务器
内网IP:(1.1.1.78), 外网IP (1.1.1.162)
- nacos服务 (8848端口)
- gateway 服务 (8080端口)
- builder 服务(8060) 此服务接了oauth2,登陆 1.1.1.162:8033 的gitlab
服务注册到nacos的IP 均为 内网IP
问题 如何才能跳转到外网 即: http://1.1.1.162:8080/builder/login 之前使用nginx时也遇到过
加了 proxy_set_header Host $host:8080;
配置就可以了 gateway 如何处理?
以下是oauth2 配置
写回答
1回答
-
大目
2020-05-08
您好,我不知道你spring security是怎么集成的。不过就你的描述,我觉得用
https://www.imooc.com/article/290816
能解决你的问题。
需要独立配置路由&过滤器。
这样会跳转到http://1.1.162/login
不改写任何代码,就想让你的项目跳转到http://1.1.162/build/login ,我觉得需要额外需要写转发规则。
022020-05-08
相似问题