Environment variables

85 views
Skip to first unread message

Felipe Coury

unread,
Aug 9, 2010, 1:05:26 PM8/9/10
to Phusion Passenger Discussions
Is it possible to set environment variables for Rails / Rack
applications in nginx, when using Passenger? I want something like
what Apache offers:

<VirtualHost *:80>
ServerName xyz.com
DocumentRoot /var/www/rails_app/public
PassengerAppRoot /var/www/rails_app
SetEnv MY_VARIABLE contents
</VirtualHost>

Or what nginx offers for fastcgi:

fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;

If not, is there a common way to mimic what I get with Apache
environment-based variables to be accessed from my Rails / Rack apps?

Thanks.

Hongli Lai

unread,
Aug 10, 2010, 6:51:34 AM8/10/10
to phusion-...@googlegroups.com


SetEnv and fastcgi_param aren't the same thing. The former sets system
environment variables, although they're also exposed through the CGI
environment. The latter only sets the CGI environment.

Phusion Passenger 3 for Nginx will provide an option comparable to
fastcgi_param: passenger_set_cgi_param.

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)

Felipe Coury

unread,
Sep 15, 2010, 12:41:43 PM9/15/10
to Phusion Passenger Discussions
Hey guys,

Thanks for the awesome work! I wonder if this feature:

> Phusion Passenger 3 for Nginx will provide an option comparable to
> fastcgi_param: passenger_set_cgi_param.

Made it to this beta 1.

Thanks!

- Felipe.

Felipe Coury

unread,
Sep 15, 2010, 12:40:00 PM9/15/10
to Phusion Passenger Discussions
Hey Hongli,

> Phusion Passenger 3 for Nginx will provide an option comparable to
> fastcgi_param: passenger_set_cgi_param.

Was this addressed in this beta you released today?

Thanks for the usual awesome work.

Best,

- Felipe.

On Aug 10, 7:51 am, Hongli Lai <hon...@phusion.nl> wrote:
> E-mail: i...@phusion.nl

Hongli Lai

unread,
Sep 15, 2010, 12:52:06 PM9/15/10
to phusion-...@googlegroups.com
On Wed, Sep 15, 2010 at 6:40 PM, Felipe Coury <felipe...@gmail.com> wrote:
> Hey Hongli,
>
>> Phusion Passenger 3 for Nginx will provide an option comparable to
>> fastcgi_param: passenger_set_cgi_param.
>
> Was this addressed in this beta you released today?

Yes it was. See Technology Preview 4.

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl

Felipe Coury

unread,
Sep 15, 2010, 1:06:21 PM9/15/10
to Phusion Passenger Discussions
Thanks so much! That will enable us here in Webbynode to fully support
env variables while deploying using git and Passenger. Great news!

Best,

- Felipe.

On Sep 15, 1:52 pm, Hongli Lai <hon...@phusion.nl> wrote:
> On Wed, Sep 15, 2010 at 6:40 PM, Felipe Coury <felipe.co...@gmail.com> wrote:
> > Hey Hongli,
>
> >> Phusion Passenger 3 for Nginx will provide an option comparable to
> >> fastcgi_param: passenger_set_cgi_param.
>
> > Was this addressed in this beta you released today?
>
> Yes it was. See Technology Preview 4.
>
> --
> Phusion | The Computer Science Company
>
> Web:http://www.phusion.nl/
> E-mail: i...@phusion.nl
Reply all
Reply to author
Forward
0 new messages