I need to two different sets of upstreams. But all my requests come from the same URL (same path). The difference is that some request will have a special argument and some won't. Depending on that, I would need to choose which upstream to use. Here is a incomplete part of an example of my configuration file:
server_name localhost;
root /var/www/something/;
upstream pool1
{
server localhost:5001;
server localhost:5002;
server localhost:5003;
}
upstream pool2
{
server localhost:6001;
server localhost:6002;
server localhost:6003;
}
location /
{
# this is the part where I need help
try_files $uri @pool1;
}
location @pool1
{
include fastcgi_params;
fastcgi_pass pool1;
}
location @pool2
{
include fastcgi_params;
fastcgi_pass pool2;
}
So...the part I don't know is how to check if the argument/parameter is in the URL and depending on that, use either location pool1 or pool2.
Any idea how can I implement this?
Thanks!