<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">I run nginx + php-fpm.<br><br>I include the following 'secure' config into my shared site config<br><br>    cat ../sec/params.shared<br>        fastcgi_param DATABASE_HOST     "localhost";<br>        fastcgi_param DATABASE_PORT     "3306";<br>        fastcgi_param DATABASE_NAME     "db_name";<br>        fastcgi_param DATABASE_USER     "db_user";<br>        fastcgi_param DATABASE_PASSWORD "db_pass";<br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">It works as intended, setting the ENV vars in PHP env.<br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">I'd like to add some vhost-specific env vars, that ONLY exist & are set for specific vhost's ENVs<br><br>For example, I'd like to set up a conditional add'n of<br><br>        set $this_token ""<br>        if ($host = '<a href="http://vhost1.example.com">vhost1.example.com</a>') {<br>            set $this_token "data";<br>10            fastcgi_param VHOST1_TOKEN  $this_token;<br>        }<br><br>But when I add this stanza to the main config above, conf check fails<br><br>    nginx: [emerg] "fastcgi_param" directive is not allowed here in /etc/nginx/sec/param.shared:10<br>    nginx: configuration file /etc/nginx/nginx.conf test failed<br><br>If instead I add<br><br>        set $this_token ""<br>        if ($host = '<a href="http://vhost1.example.com">vhost1.example.com</a>') {<br>            set $this_token "data";<br>        }<br>        fastcgi_param VHOST1_TOKEN  $this_token;<br><br>it passes check<br><br>    nginx: the configuration file /etc/nginx/nginx.conf syntax is ok<br>    nginx: configuration file /etc/nginx/nginx.conf test is successful<br><br>In this case the ENV var "VHOST1_TOKEN" is corrrectly defined in the match case, but it is also *defined*, though null, for any/all other vhosts.<br><br>How do I construct this conditional ENV var setting to ONLY set/defined the vars on host match?<br><br></div></div>