Using NGINX as a reverse proxy, I want to tag which load balancer/proxy the request can in on, and pass that to the end app servers...
For example, we have 2 ingress connections, using round-robin DNS to 3 load balancers,
so, connection one has 3 pubic IP's and connection two has 3 IP's. each pair points to a load balancer and they're using proxy pass upstream to send traffic to the 10 web/app servers.
I want to tag which of the 3 LB's the request comes in on, I'd love to tag it based on the connection too, if you know how.
upstream web_cluster {
random;
# web server ip addresses x 10
}
location / {
proxy_pass http://web_cluser;
proxy_set_header Proxy $proxy_server_host_name; // here
proxy_set_header Route $proxy_server_public_ip; // here
proxy_pass_request_headers on;
}
The servers are all deployed via Ansible scripts, so I wouldn't be able to hard-code server names into the proxy_set_header
options.
Thanks