Nginx + PHP passing $_SERVER params

A similar way to apache's setEnv method to use with nginx and php-fpm/php-cgi.

The following code adds a server side defined variable to Your $_SERVER array (in PHP):

location ~ \.php$ {
    ...
    fastcgi_param YOUR_VARIABLE "your-value";
    ...
}

Such variables are a convenient way to specify an application environment, like "production", "stage", "dev".