Nginx map assigned variable usage in upstream?

George nginx-forum at
Thu Feb 24 11:19:57 UTC 2022

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          ;

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?



Posted at Nginx Forum:,293738,293738#msg-293738

More information about the nginx mailing list