health_check for dynamic upstream

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

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;

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:,272525,272525#msg-272525

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