skip to Main Content

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"

2

Answers


  1. Chosen as BEST ANSWER

    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


  2. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search