Forum: Ruby on Rails redirect_to for Nginx Reverse Proxy?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
37bf861101bbbb89b6c0830968d0d3c4?d=identicon&s=25 The Chromag (chromag)
on 2012-11-02 14:46
I'm trying to figure out the best way to do this.  I'm working on a web
application where the entire thing requires the user to be logged in.  I
use a before_filter in all the controllers to check for the logged in
session variable.  If it doesn't exist, I redirect to the "login"
controller and the "index" action.

We're planning on rolling out this web app to multiple clients soon so
I'm planning on putting multiple servers behind an Nginx reverse proxy.
So, for example, when the user goes to:

It accesses a server that serves site1 (i.e.
without the site1).  Another server will serve site2.

Problem is - if the user isn't logged in it makes the call to:

redirect_to :controller => "login", :action => "index"

This works fine in a single server configuration - but in this case it
redirects the browser to:

What's the best way to handle this kind of situation?  Will there be any
issues with session variables in this type of reverse proxy situation?

This topic is locked and can not be replied to.