Hello,

I am trying to use a MAP function based on HOSTNAMES to determine if this 
domain should fastcgi_pass to a php5 or php7 container, but am having problems.

My map looks like
 
map $host $php_proxy_container {
  hostnames;

  default "php5fpm:9000";

  www.example.com <http://www.example.com/>    "php7fpm:9000";
}


My fastcgi file looks like

  fastcgi_pass   $php_proxy_container;


I have tried also moving the :9000 of the mapping to the the fastcgi_pass to 
look like  fastcgi_pass   $php_proxy_container:9000 but alas it did not work 
either.

I am using MAPs in other places in this same format and they work.

I get a generic 502 bad gateway, and nothing more in the http log.  Changing 
the fastcgi_pass line to the exact value in the map and restarting does work.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to