I want to deploy two services with different URLs.
- match:
uri:
prefix: /pune
route:
- destination:
host: wagholi
port:
number: 8080
- match:
uri:
prefix: /pune/{location}
route:
- destination:
host: yerwada
port:
number: 8080
- match:
uri:
prefix: /pune/{local}/here
route:
- destination:
host: hadapsar
port:
number: 8080
In this scenario, When I am hitting API getting 404 Not Found /pune/yerwada when I pass location value as yerwada. Also I am passing /pune/hadapsar/here getting same error 404 Not Found /pune/hadapsar/here, When I pass hadapsar at the place of local. !!!!!
We can go with regex for uri.
- match:
uri:
prefix: /pune
route:
- destination:
host: wagholi
port:
number: 8080
- match:
uri:
regex: \/pune/\/(.+)
route:
- destination:
host: yerwada
port:
number: 8080
- match:
uri:
prefix: \/pune\/(.+)\/here
route:
- destination:
host: hadapsar
port:
number: 8080
Do the requests pass in a header named location
with value of pune
? If "no" then remove this from the matching rules - it is the cause for the requests not being matched by uri
prefix alone:
- headers:
location:
exact: pune
Just in case, here is a link to the relevant doc.