Forum: Ruby on Rails detecting protocol with proxy

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
parker (Guest)
on 2005-11-17 05:27
(Received via mailing list)
Hey,

I'm trying to use apache to proxy requests through to one rails instance
(lighttpd) for both secure and insecure pages.  I want to do this by
applying filters (a nice 20 line solution) that look at the protocol and
redirect the user where appreciate (i.e. http://domain/login ->
https://domain/login).

When I try this the redirect happens...and happens...and happens; Apache
handles the https request, but rails decides that it's still a plain old
http request and redirects again.  What's interesting is that it gets
the
SERVER_NAME from apache (it's in the logs), so it's getting the URL but
not the protocol.

I understand that from rails' perspective this probably does look like
an
http request, it after all fields an http request even if apache is
securing the network connection.  Even so, any ideas on how to get
around
this?  How are other folks handling showing users secure pages for
things
like logins, password changes, viewing sensitive docs, etc and http for
everything else?

Thanks,

pt.
------
Parker T.
Professional
(w) http://placesite.com
(c) 510.541.0125
This topic is locked and can not be replied to.