【发布时间】:2021-01-26 20:34:26
【问题描述】:
我是spring cloud gateway的新手。我有以下情况:
我要映射的路径:/myapp/v1/ms1/**
目标网址:http://localhost:8080/api/v1/ms1/**
- id: microservice1
predicates:
- Path=/myapp/v1/ms1/**
uri: http://localhost:8090/api/v1/ms1/**
所以对于 http://gateway:port/myapp/v1/ms1/message ,我想重定向到 http://localhost:8090/api/v1/ms1/message。
所以这应该自然发生,还是我需要使用任何过滤器,如 RewritePath 过滤器。
我正在寻找建议。
提前致谢。
【问题讨论】:
-
简单的方法是使用过滤器重写路径
标签: spring spring-cloud-gateway