0

Just asked on StackOverflow, but more appropriate here.

I have my Apache HTTP server set up to forward all requests to Tomcat, i.e. proxy_ajp.conf looks like:

ProxyPass / ajp://localhost:8009/

where Tomcat is listening on port 8009. This works find except when I try to access squirrelmail (i.e. webmail) on the server. Is there a way to forward all requests to Tomcat except those going to /webmail/?

Thanks for the help.

Joe
  • 103
  • 1

3 Answers3

1

Use

ProxyPass /webmail !
ProxyPass / ajp://localhost:8009/
Janne Pikkarainen
  • 31,454
  • 4
  • 56
  • 78
0

Absolutely. I do this for web apps where I don't want people snooping in WEB-INF.

  ProxyPass / ajp://localhost:8009 /

  <Proxy />
    Order Deny,Allow
    Allow from All
  </Proxy>

  <Proxy /webmail>
    Order Deny,Allow
    Deny from All
  </Proxy>
Ernest Mueller
  • 1,189
  • 2
  • 12
  • 25
  • Thanks, but I was actually hoping to still let request to webmail go through. They just wouldn't go to Tomcat. Someone on StackOverflow suggested this: RewriteEngine On RewriteCond REQUEST_URI !^/webmail* RewriteRule / /tomcat/ ProxyPass ajp://localhost:8099/ but the rewrite rule doesn't seem to be kicking in. – Joe Aug 31 '10 at 03:14
0

A second proxy pass for /webmail ahead of the proxy pass for / may work. I believe they are matched in order.

BillThor
  • 27,354
  • 3
  • 35
  • 69