spring:
cloud:
loadbalancer:
enabled: true
discovery:
client:
simple:
instances:
xxx-service:
- uri: ws://ip:port
gateway:
routes:
- id: local_route
uri: http://localhost:80 # 转发的目标服务
predicates:
- Path=/sso/** # 匹配路径
filters:
- StripPrefix=1 # 去除路径中的第一个部分,例如将/local-service/hello 转换为 /hello 发送到目标服务
- id: xxx_service_route
uri: lb://xxx-service
predicates:
- Path=/xxx/**
filters:
- StripPrefix=1
版权归属:
江南的风
许可协议:
本文使用《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》协议授权
评论区