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
评论区