In OpenShift how can we do URL rewriting for external requests

628 Views Asked by At

I tried to find information in the documentation of OpenShift, but could not discover how to use an OpenShift Route to perform URL rewriting. Do routes allow you to perform reverse-proxy like functionality such as URL rewriting?

(Edited 10/16 to add additional information the original author had placed in comments.)

1

There are 1 best solutions below

2
On

See the route-specific annotations section of the docs, especially "A route specifying a rewrite target" and Table 3. rewrite-target examples.

Also make sure that you understand how path based routes work.

In short, the rewrite rule will replace whatever path you specify in your path based routing (spec.path) with whatever you specify in your rewrite rule annotation (haproxy.router.openshift.io/rewrite-target) .