How do you set server specific ENV values in Nginx?

It turns out that if you are using fastcgi you can get around this by passing the values from fastcgi_param.

server {
    listen 80;
    server_name domain;

    # Pass PHP scripts to php-fastcgi listening on port 9000
    location ~ path/to/it {
        include fastcgi_params;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_param FOO "bar";
    }
}