解决SpringCloudGateway Unable to find RoutePredicateFactory with name RewritePath 异常
想要重写访问路径时报错Unable to find RoutePredicateFactory with name RewritePath这时因为你重写路径时并没有启动filter上面为错误示例,既然想重写路由,应该在Filter中添加RewritePath正确的姿势为#配置SpringCloud Gateway的路由cloud:gateway:route...
·
想要重写访问路径时报错
Unable to find RoutePredicateFactory with name RewritePath
这时因为你重写路径时并没有启动filter
上面为错误示例,既然想重写路由,应该在Filter
中添加RewritePath
正确的姿势为
#配置SpringCloud Gateway的路由
cloud:
gateway:
routes:
- id: penrose-server-router
uri: lb://penrose-server
predicates:
- Path=/penrose-server/**
filters:
- RewritePath=/penrose-server/(?<segment>.*), /$\{segment}
完美解决
更多推荐
已为社区贡献1条内容
所有评论(0)