Welcome! Log In Create A New Profile

Advanced

Nginx map assigned variable usage in upstream?

February 24, 2022 06:19AM
I am trying use a Nginx map assigned variable in an upstream but it doesn't seem to work?

The map is concatenated $uri$args assigning a PHP-FPM fastcgi PHP pool to variable $pool and then setting the $pool variable in an upstream.

map $uri$args $pool {
default 127.0.0.1:9000;
"~/index.php/args" 127.0.0.1:9002;
}

upstream php {
zone php_zone 64k;
server $pool;
keepalive 2;
}

But if I try this, nginx config test gives me

nginx -t
nginx: [emerg] host not found in upstream "$pool" in ...

What am I missing?

cheers

George
Subject Author Posted

Nginx map assigned variable usage in upstream?

George February 24, 2022 06:19AM

Re: Nginx map assigned variable usage in upstream?

OS_Killer February 24, 2022 06:28AM

Re: Nginx map assigned variable usage in upstream?

OS_Killer February 24, 2022 06:31AM

Re: Nginx map assigned variable usage in upstream?

George February 24, 2022 06:45AM

Re: Nginx map assigned variable usage in upstream?

OS_Killer February 24, 2022 06:52AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 142
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready