【发布时间】:2021-07-23 00:17:48
【问题描述】:
我的 Spring Cloud Gateway 配置中有以下路由:
- id: pgadmin
uri: lb://pg-admin-service
predicates:
- Path=/pgadmin/**
filters:
- RewritePath=/pgadmin(?<segment>/?.*), $\{segment}
- RewriteLocationResponseHeader=AS_IN_REQUEST, Location, , <---- this line is incorrect
请求以未经身份验证的用户身份在http://10.0.0.100/pgadmin/ 上发出。应用程序返回一个包含位置标头的响应,其值为:
http://10.0.0.100/login
浏览器尝试重定向到该 URL。相反,它应该重定向到:
http://10.0.0.100/pgadmin/login
路由定义中RewriteLocationResponseHeader 的正确值是多少?
非常感谢
JT
【问题讨论】:
-
试试
- RewriteLocationResponseHeader -
嗨,如果您发现了对此的破解,请提供答案。提前致谢
-
@AnjanKrishna 我在下面发布了对我们有用的内容。如果可行,请您接受答案吗?
标签: spring-boot spring-cloud spring-cloud-gateway