Conditional fastcgi_param

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

On Fri, Sep 18, 2009 at 02:41:37PM +0500, Ziyad S. 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;

Hello!

On Fri, Sep 18, 2009 at 02:41:37PM +0500, Ziyad S. 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 D.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs