Mongrel & nginx - question

Nginx configuration as proxy for mongrel cluster allows sending
additional request variables as an example shows.

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect false;
proxy_pass http://mongrel

Ho can I access e.g. the ‘Host’ header info from rails code? I cant find
it in rails request object.

Thanks for any hint,
David

On Thu, 5 Oct 2006 14:53:41 +0200
David M. [email protected] wrote:

Ho can I access e.g. the ‘Host’ header info from rails code? I cant find
it in rails request object.

All headers that come in from the server are translated almost exactly
like CGI requires: all caps, underscores () replacing dash (-),
beginning with HTTP
. Then a few oddball ones are generated like
PATH_INFO, REQUEST_PATH, etc.

Too bad the CGI folks couldn’t be bothered to be consistent, but that’s
what everyone uses to that’s what Mongrel does.


Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu

http://mongrel.rubyforge.org/
http://www.lingr.com/room/3yXhqKbfPy8 – Come get help.

Zed A. Shaw wrote:

On Thu, 5 Oct 2006 14:53:41 +0200
David M. [email protected] wrote:

Ho can I access e.g. the ‘Host’ header info from rails code? I cant find
it in rails request object.

All headers that come in from the server are translated almost exactly
like CGI requires: all caps, underscores () replacing dash (-),
beginning with HTTP
. Then a few oddball ones are generated like
PATH_INFO, REQUEST_PATH, etc.

Too bad the CGI folks couldn’t be bothered to be consistent

Nor good spellers.

Cough… HTTP_REFERER… cough…

Joe

ENV[“HTTP_HOST”] ?