I use SetEnv in Apache to set some variables in virtualhosts that I recover in PHP using $_SERVER[the_variable].
$_SERVER[the_variable]
Now I am switching to Perl Catalyst and
location / { ... fastcgi_param APPLICATION_ENV production; fastcgi_param APPLICATION_CONFIG user; ... }
but it's for PHP-CGI