I have an Apache reverse proxy set to move requests to a Tomcat Applet. The config is similar to:
<VirtualHost 100.100.100.100:80>
ProxyPass /AppName/App http://1.1.1.1/AppName/App
ProxyPassReverse /AppName/App http://1.1.1.1/AppName/App
</VirtualHost>
I also have a page called summary.html
that exists on 1.1.1.1
as:
http://1.1.1.1/AppName/summary.html
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 100.100.100.100) and not the Tomcat (IP 1.1.1.1).
Should I add http://1.1.1.1/AppName/
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.
Thanks.
EDIT: This is the dump from Wireshark:
GET /AppName/ HTTP/1.1
Host: 100.100.100.100
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
I suspect you forgot "ProxyPreserveHost On".
Without this directive, your app is contacted with the HTTP "Host: 1.1.1.1" header, while when you were browsing directly it would see "Host: the.domain.com".
Adding it like this should work just fine:
Or even:
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".
I would use a rewrite rule instead.
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule
try: