我想部署两个具有不同URL的服务。
- match:
- headers:
location:
exact: pune
uri:
prefix: /pune
route:
- destination:
host: wagholi
port:
number: 8080
uri:
prefix: /pune/{location}
route:
- destination:
host: yerwada
port:
number: 8080
uri:
prefix: /pune/{local}/here
route:
- destination:
host: hadapsar
port:
number: 8080
在这种情况下,当我将API的位置值作为yerwada传递给API时,得到404 Not Found / pune / yerwada。我也通过/ pune / hadapsar /这里得到相同的错误404 Not Found / pune / hadapsar / here,当我在本地位置通过hadapsar时。 !!!!!
请求是否传递名为location
的标头,其值为pune
?如果为“否”,则将其从匹配规则中删除-这是导致单独使用uri
前缀不匹配请求的原因:
- headers:
location:
exact: pune
以防万一,这里是指向relevant doc的链接。