赞
踩
RewritePath GatewayFilter工厂接受路径regexp参数和替换参数
- spring:
- cloud:
- gateway:
- routes:
- - id: rewritepath_route
- uri: https://example.org
- predicates:
- - Path=/red/**
- filters:
- - RewritePath=/red(?<segment>/?.*), $\{segment}
使用例:
- - id: admin_routh
- uri: lb://renren-fast #目标微服务名!而且是以负载均衡方式去获取!
- predicates: #断言
- - Path=/api/**
- filters:
- - RewritePath=/api/(?<segment>/?.*), \renren-fast\$\{segment}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。