httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Millett <bmill...@gmail.com>
Subject Re: [users@httpd] how to use ProxyPassReverse* with more complex a ProxyPassMatch
Date Sun, 09 Dec 2012 13:48:42 GMT
On Sun, 09 Dec 2012 00:45:05 +0100
Christoph Anton Mitterer <calestyo@scientia.net> wrote:

> Hi.
> 
> I'm using a reverse proxy set up with ProxyPassMatch as the space I map
> to is rather complex and can't be mapped with a normal ProxyPass.
> 
> 
> Now the problem is obviously that:
> ProxyPassReverse
> ProxyPassReverseCookieDomain
> ProxyPassReverseCookiePath
> are only made for the simply ProxyPass form and there are no
> ProxyPassReverseMatch* versions.
> 
> Is this planned and is there some way to work around this in the
> meantime?
> 
> 
> Thanks,
> Chris.

Ok, so the mod_rewrite is your friend.  This is a working example that does a
reverse proxy to a tomcat server.  Its not the best, but it is functional and
I post it as an example of how to use rewrite to accomplish what you cannot do
with the simple proxypass stuff:

  <Location "/helpdesk">
     <LimitExcept POST GET PUT>
          Require all denied
     </LimitExcept>
     DirectoryIndex logon.jsp
     RewriteEngine On
     RewriteRule \.(pl|php|cgi) - [QSA,PT,L]
     RewriteRule \.(jpg|jpeg|gif|png|html)$ - [QSA,PT,L]
     RewriteRule ".*/WEB-INF/?.*" - [L,F,NC]
     RewriteRule \.(jsp|jspx|do) "http://localhost:8080%{REQUEST_URI}" [QSA,P,L] 
     RewriteRule ".*/servlet/.*" "http://localhost:8080%{REQUEST_URI}" [QSA,P,L] </Location>
  <Location "/helpdesk">


-- 
Brian Millett
"...which leads me to believe that the ancient race described in our holy
 books may have returned. If true, this holds grave danger for all of us."
           -- [ G'Kar, "Revelations"]

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message