server:
port: 8080
spring:
application:
name: gateway
cloud:
gateway:
routes:
- id: guo-system1
uri: https://www.baidu.com
predicates:
- Weight=group1, 8 #路由权重比,80%
- Host=**.baidu.com #请求主机域名匹配 **.baidu.com
- Path=/gateway #请求路径
- Method=GET #请求方法
- Header=X-Request-Id, \d+ #请求头信息
- Query=foo, ba. #请求参数值匹配foo=ba.
- Query=smile #请求参数匹配
- Cookie=sessionId, test #cookie值匹配
- After=2021-06-21T11:50:00+08:00[Asia/Shanghai] #请求时间匹配
filters:
- StripPrefix=1
- id: guo-system2
uri: https://www.json.cn
predicates:
- Weight=group1, 2 #路由权重比,20%
filters:
- StripPrefix=1