I have an Apache reverse proxy set to move requests to a Tomcat Applet. The config is similar to:

    ProxyPass /AppName/App
    ProxyPassReverse /AppName/App

I also have a page called summary.html that exists on as:

When I browse directly to it I have no problem viewing it, however if I try to get there via the reverse proxy I get a blank page. Wireshark shows me a 503, but this one is coming from the Apache reverse proxy (IP and not the Tomcat (IP

Should I add to the config? How? I tried it but I get a blank page, however this one shows on the URL bar of the browser the internal IP of the Tomcat, so, no go.

Help is appreciated.


EDIT: This is the dump from Wireshark:

GET /AppName/ HTTP/1.1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Cache-Control: max-age=0
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: keep-alive

HTTP/1.1 404 Not Found
Date: Tue, 30 Jan 2012 09:08:51 GMT
Server: Apache
Content-Length: 1
Connection: close
Content-Type: text/html; charset=iso-8859-1

Adding it like this should work just fine:

    ProxyPass /AppName/
    ProxyPassReverse /AppName/

Or even:

    ProxyPass /AppName/summary.html
    ProxyPassReverse /AppName/summary.html
    ProxyPass /AppName/App
    ProxyPassReverse /AppName/App

Can you clarify what issue occurs when you have a config like this in place? I'm not quite sure what you mean by "this one shows on the URL bar of the browser the internal IP of the Tomcat".

  • When you browse to,html it presents a blank page and the URL on the browser gets changed to – Mr Aleph Jan 30 '12 at 15:43
  • Also, what if I want to do a generic error handling on Tomcat. Ideally every time a 404 or 500 or whatever is thrown I want to show a customized error.html. I have that in place on the config for Tomcat, however with the VirtualHost on Apache it doesn't display the error page either. – Mr Aleph Jan 30 '12 at 15:46
  • @MrAleph Then you need to trace what's actually happening with the request; something's responding with a redirect, but Apache shouldn't allow that Location header in a response unmodified with a proper ProxyPassReverse config in place. Have you tried with the configs that I've provided? – Shane Madden Jan 30 '12 at 16:10
  • I am doing it as I type. I'll post the reply in a bit. Thanks for the help – Mr Aleph Jan 30 '12 at 16:13
  • Same story. All I get is a blank page. If I go directly to then it's fine. Just as a test I assigned an external IP to If I go directly to that one as 300.300.300.300/AppName/symmary.html then it's also fine. The minute I try from the reverse proxy then it doesn't work. So my guess is that the reverse proxy doesn't know where to go get that file. I can hardcode it as you said as ProxyPass /AppName/summary.html but that would not work for the error pages or if I want to add more pages – Mr Aleph Jan 30 '12 at 18:25

I would use a rewrite rule instead.



    RewriteRule ^/AppName/(.*)$1 [P]

I suspect you forgot "ProxyPreserveHost On".

Without this directive, your app is contacted with the HTTP "Host:" header, while when you were browsing directly it would see "Host: the.domain.com".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.