<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hello,<div class=""><br class=""></div><div class="">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.</div><div class=""><br class=""></div><div class="">My map looks like</div><div class=""> </div><div class=""><div class="">map $host $php_proxy_container {</div><div class=""> hostnames;</div><div class=""><br class=""></div><div class=""> default "php5fpm:9000";</div><div class=""><br class=""></div><div class=""> <a href="http://www.example.com" class="">www.example.com</a> "php7fpm:9000";</div><div class="">}</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">My fastcgi file looks like</div><div class=""><br class=""></div><div class=""> fastcgi_pass $php_proxy_container;</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">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.</div><div class=""><br class=""></div><div class="">I am using MAPs in other places in this same format and they work.</div><div class=""><br class=""></div><div class="">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.</div><div class=""><br class=""></div></body></html>