I'm trying to write a rule to proxy /varz requests to all my backends for a production dashboard. I'd like to specify the host and port in the request URL. Here's what I've tried, but I get a 502 Bad Gateway from nginx.
[code]
location /dashboard/varz {
if ($args ~ "host=([a-z0-9]*)&port=([0-9]*)") {
set $varz_host $1;
set $varz_port $2;
proxy_pass http://$varz_host.mydomain.com:$varz_port/varz;
}
proxy_redirect off;
...
}
[/code]
I'm running nginx/0.6.36. Any other suggestions?
Thanks,
Jared