• Apache ProxyPass question#

  • jrotering Reply #1, 3 months, 2 weeks ago

    Reply
    I had a simple proxy set up from one Apache server to another, to allow my MODX sites hosted on 'server2' to be served via proxy by 'server1'. The apache config on 'server1' looks like this:

    ProxyPass /myfolder http://server2.mydomain.net/myfolder
    ProxyPassReverse /myfolder http://server2.mydomain.net/myfolder

    Additionally, I was overriding the ++site_url system setting in the <base href> of the 'myfolder' resource and all its child resources.

    This was working great, for anonymous users. But then I added a plugin that authenticates users based on their IP address. All users get authenticated (as either 'internal' or 'external'). I developed this completely separately, with no thought of how it would impact my proxy set-up.

    Because authenticated user sessions use cookies, my proxy configuration as-written no longer works. Well, it works about like a basic redirect - users can come in on a 'server1' URI, but they get sent to the corresponding 'server2' URI.

    I know there are some additional ProxyPass directives that pertain to the use of cookies, and I know there are some MODX system settings that pertain to the cookie domain... but I really have no idea what I'm doing.

    What I'd like to do is be able to set up Proxy arrangements, on a folder by folder basis (root-level resources), that would properly handle the user cookies/sessions. When one of my "sites" (folders, root-level resources & their child resources) "goes live", I want to set up the proxy and have the "server1" URL be the official URL of the new site.

    Does anyone know what I would need to do to go about this?