Answer the question
In order to leave comments, you need to log in
Nginx and get parameters, how to send to separate php-fpm pool?
Actually, there is a URL domain.com/somefile.php?sometext& id={id} &aid={aid}&m={b}&x={c}
I want to send everyone who passes the id={id} parameter to somefiele.php , to a specific php pool via location, and all those who do not pass the id={id} parameter to somefile.php (there is no id={id} parameter in the URL ) to another pool.
I suppose that through the location, but I can’t light up how ...
But I don’t know how ... Bright heads, advise ?!
Answer the question
In order to leave comments, you need to log in
If you follow the documentation , then something like this:
location /somefile.php\?.* {
error_page 418 = @with_id;
recursive_error_pages on;
if ($args ~ id=) {
return 418;
}
#without id
...
}
location @with_id {
...
}
map arg_id backendname {
blah localhost:8080;
blah2 localhost:8080;
default localhost:8081; }
...
proxy_pass http://$backendname;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question