I have a server server.example.com
which serves Tomcat on port 80 via a ProxyPass
/ProxyPassReverse
to 8080 and a Drupal site on the same box at server.example.com:8001
. If I enter in the port 8001 explicitly, the Drupal site behaves properly, but I need to make it accessible via server.example.com/blog
so I created a ProxyPass
/ProxyPassReverse
for /blog http://server.example.com:8001
which serves the initial page for the Drupal site correctly, but once the form on the home page of Drupal is filled out and submitted, which POSTs to /
, the site changes to the Tomcat site, presumably because the / is not relative to the current host on post :8001. How can I get the ProxyPass
for /blog
to remain persistent so that all subsequent requests remain within the :8001 VirtualHost
(Drupal site)?
One thing I tried was with mod_rewrite:
RewriteCond %{HTTP_REFERER} /^blog/.*$
RewriteRule (.*) %{HTTP_HOST}:8001/$1 [L,P,NC]
But that did nothing at all as far as I can tell. I was hoping that if the initial request was for /blog then the referrer would be as well and I could keep requests on the :8001 virtualhost. Perhaps someone can explain why that is flawed.