Conditional fastcgi_param
Maxim Dounin
mdounin at mdounin.ru
Fri Sep 18 14:02:13 MSD 2009
Hello!
On Fri, Sep 18, 2009 at 02:41:37PM +0500, Ziyad Saeed wrote:
> fastcgi_param isn't allowed inside an if statement
> The code below doesn't work. Any workaround available
>
> if ($host ~* ^dev\.flow3\.local$) {
> fastcgi_param FLOW3_CONTEXT Development;
> }
> if ($host ~* ^flow3\.local$) {
> fastcgi_param FLOW3_CONTEXT Production;
> }
map $host $context {
dev.flow3.local Development;
flow3.local Production;
}
fastcgi_param FLOW3_CONTEXT $context;
See http://wiki.nginx.org/NginxHttpMapModule for details.
Maxim Dounin
More information about the nginx
mailing list