Hi Yan,
If you just need to access the env var which doesn''t change like
SERVER_NAME, you should be able to access it directly using "request".
However, if your env var is dynamicly set, you can try my way.
I use mod_rewrite to proxy to Mongrel. In your httpd.conf (you need mod_header)
RequestHeader set X_YOUR_ENV your_value
And in Rails access it by
request.env["HTTP_X_YOUR_ENV"]
Hope it helps,
Kevin
On 8/4/06, Yan Sarazin <ysarazin@greenlightmedia.ca>
wrote:> Hi Kevin,
>
> I found a thread you started regarding Passing an env variable from Apache
> to Mongrel using RequestHeader. I was able to pass a variable I created
> with a string, however I do not know how to put in the environment (for
> example SERVER_NAME) to Mongrel. I was hoping you may be able to share
> your code or give me a little insight on how to do it.
>
> Much appreciated,
>
> Yan
--
Kevin Chen
http://www.realmatic.com