On Thu, 5 Oct 2006 14:53:41 +0200 David Marko <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > 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.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://www.zedshaw.com/ http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
ENV["HTTP_HOST"] ? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Zed A. Shaw wrote:> On Thu, 5 Oct 2006 14:53:41 +0200 > David Marko <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> 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 consistentNor good spellers. Cough... HTTP_REFERER... cough... Joe -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---