Home > Net >  How to create reverse proxy that forward traffic to kubernetes ingress controller such as haproxy in
How to create reverse proxy that forward traffic to kubernetes ingress controller such as haproxy in

Time:11-12

nginx configuration

i tried to forward traffic from server 192.168.243.71 to domain that show in command "oc get routes" / "kubectl get ingress", but its not as simple as that. The fact is my Nginx Reverse Proxy in server 192.168.243.x will forward the request to the IP Address of loadbalancer instead of the real domain that i wrote in nginx.conf

the result when i access 192.168.243.71

I was expecting it will show the same result when I access the domain via web browser that show in "oc get routes" or "kubectl get ingress"

CodePudding user response:

Solved by adding set $backend mydomainname.com in server block and add dns resolver resolver 192.168.45.213; proxy_pass http://$backend; server in location block.

Result

CodePudding user response:

You can actually add the set $backend mydomainname.com on the server block, and also you need to add dns resolver resolver 192.168.45.213; proxy_pass http://$backend; server in the location of block

  • Related