Nginx Ingress Selective Reverse Proxy Location Rewrite

8/13/2018

I have an Nginx Ingress that I'm trying to use to replace my HTTPD reverse proxy.

One of my servers behind the proxy returns a redirect containing this url https://proxy/endpoint. Originally with my HTTPD reverse proxy, I was able to modify outgoing http/https traffic headers (specifically location) and regex the proxy to the proper external dns name. How can I achieve this with Nginx Ingress. I see

nginx.ingress.kubernetes.io/proxy-redirect-from
nginx.ingress.kubernetes.io/proxy-redirect-to

Essentially I would like to modify the outgoing traffic to change the location from https://proxy to whatever I need it to be.

-- annihil8ted
kubernetes
kubernetes-ingress
nginx
nginx-reverse-proxy
proxy

1 Answer

8/13/2018

It was indeed those two fields I had to add as annotations to my Ingress.yaml. Once those were in place, things got routed correctly.

-- annihil8ted
Source: StackOverflow