Arguments from the requests are not taken into account when nginx choosing
locations.
Try to use the 'map' directive instead.
For example:
=======
map $arg_target $backend {
 'server1' 'server1';
 'server2' 'server2';
  default  'server1';
}

server {
 listen 80;
  location = /index.html {
   proxy_pass http://$backend;
  }
}
=======
https://nginx.org/en/docs/http/ngx_http_map_module.html#map
https://nginx.org/en/docs/http/ngx_http_core_module.html#var_arg_

Posted at Nginx Forum: 
https://forum.nginx.org/read.php?2,293708,293710#msg-293710

_______________________________________________
nginx mailing list -- nginx@nginx.org
To unsubscribe send an email to nginx-le...@nginx.org

Reply via email to