Conditional fastcgi_param

Igor Sysoev is at rambler-co.ru
Fri Sep 18 13:47:28 MSD 2009


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;
>             }

http {

    map $http_host  $flow3_context {
        default           Production;
        dev.flow3.local   Development;
    }

    server {

        location ... {

            fastcgi_param  FLOW3_CONTEXT  $flow3_context;


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list