We have an Apache webserver (acting as a proxy) that sits in front of several servers that have different applications running on them: IIS, Tomcat, jBoss, etc. The Apache server acts as a proxy on our single static external IP address. We have multiple domain names pointing to the single IP address, and Apache reroutes / proxies requests to the correct servers.
One issue is that when proxying to the IIS6 instance, the requests are routed all right, but when the user types in the domain name example.com/home their address bar changes to 192.168.10.30/home or whatever the internal IP address for that server is. Ouch.
Note: I'm not blaming IIS6, but it is the only box we have experienced the issues with.
Here is the VirtualHost entry in Apache that I am using. Am I missing something with the config?
<VirtualHost *:80> ServerName example.com ServerAlias www.example.com ProxyPass / http://192.168.10.50/ ProxyPassReverse / http://192.168.10.50/ ProxyPreserveHost On </VirtualHost>
Here is the 502 proxy error that SOMETIMES appears on requests (could be any random request -- css, js, html, etc.):
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>502 Proxy Error</title> </head><body> <h1>Proxy Error</h1> <p>The proxy server received an invalid response from an upstream server.<br /> The proxy server could not handle the request <em><a href="/public/example/js/jquery-1.3.2.min.js">GET /public/example/js/jquery-1.3.2.min.js</a></em>.<p> Reason: <strong>Error reading from remote server</strong></p></p> </body></html>