You’re using nginx ingress controller which does not hav e this facility. You have to use nginx plus ingress controller for this, Its just the upgraded version with additional features.
nginx.org/rewrites: "serviceName=tea-svc rewrite=/;serviceName=coffee-svc rewrite=/beans/"
- host: cafe.example.com
- path: /tea/
- path: /coffee/
Below are the examples of how the URI of requests to the tea-svc are rewritten (Note that the/tea requests are redirected to /tea/).
/tea/ -> /
/tea/abc -> /abc
Below are the examples of how the URI of requests to the coffee-svc are rewritten (Note that the/coffee requests are redirected to /coffee/).
/coffee/ -> /beans/
/coffee/abc -> /beans/abc