I searched many forums , found many similar topics, but none works for me( I have this configuration:
upstream 8083 { server 127.0.0.1:8083; }
upstream 8084 { server 127.0.0.1:8084; }
split_clients "upstream${remote_addr}" $default {
50% 8083;
50% 8084;
}
map $arg_upstream $upstream {
default $default;
"8083" "8083";
"8084" "8084";
}
location / {
if ($arg_upstream = "8083") {
proxy_pass http://8083;
break;
}
if ($arg_upstream = "8084") {
proxy_pass http://8084;
break;
}
proxy_pass http://$default;
}
But after going by url site/?upstream=8084 I have no switching to 8084 upstream. If I test my config by changing to:
if ($arg_upstream = "8083") {
return 200 "upstream 8083"
}
if ($arg_upstream = "8084") {
return 200 "upstream 8084"
}
I see text perfectly like needed! Where am I going wrong? Thanks!
this is answer to my question, it was decided by map 'http_cookies':
and location part: