health_check for dynamic upstream

Kira_Belka nginx-forum на forum.nginx.org
Пн Фев 20 14:35:58 UTC 2017


Hi!
I faced with trouble.
I have to upstreams and I route requests to them by some headers like
$user_agent or $http_x_forwarded_proto 
so it looks like:

map $some_header $backend {
default  "first";
some_value "second";
}
   upstream first {}
   upstream second {}

server {
proxy_pass $backend;
health_check;
}

I get error. 
So my question how I can use health_check for this case?
Thank you for any help. 
I can cookies and I 'd love share it :P

Posted at Nginx Forum: https://forum.nginx.org/read.php?21,272525,272525#msg-272525



Подробная информация о списке рассылки nginx-ru