We've been having problems with Apache and mod_proxy at the workplace for a couple of days. The scenario was the following: there is server A which listens on HTTPS (with Apache) and server B which uses mod_proxy to serve the contents for A in a subdirectory. B runs CentOS with Apache 2.0.52. The issue was that the connection worked if you hit refresh continuously, but if you waited a couple of minutes between page refreshes, you've received the error saying something along the line of
error the proxy server received an invalid response from an upstream server. This lead me to believe that it's an issue with the persistent connections so I disabled it on server A and now everything is working (although much slower). I suggested to the admin to server B to update Apache, but people just don't like to break working servers (more so if they don't have a great packaging system – hint use Debian ;-) ). If some of you have the same problem, hopefully this helps.
What was also weird about the situation is the fact that I couldn't reproduce it on other machines which had different versions of Apache (I've tried on Apache 2.2.2 with the following configuration:
ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass /foo https://www.example.com/bar ProxyPassReverse /foo https://www.example.com/bar SSLProxyEngine onand everything worked fine. So this might be a bug in the particular Apache version, but then again good luck convincing people to upgrade :-)
Update: I've forgot to mention how to disable persisten connections. Find the line in your apache configuration file which says
KeepAlive On and change it to
KeepAlive Off (if you don't find such a line, add
KeepAlive On to the end of the configuration file). Then restart apache.