A Proxy Error in IBM HTTP Server causes an "HTTP 502 Bad Gateway" error response to the browser.
The user sees a 502 Proxy Error in the browser that says:
The proxy server received an invalid response from an upstream server. The proxy server could not handle the request ....
The IBM HTTP Server error log displays errors similar to:
proxy: Error reading from remote server returned by ....
The most common cause of this problem is when the back-end web server is either not using KeepAlive, or is using too low of a value for KeepAliveTimeout.
IBM HTTP Server is configured as a proxy or reverse proxy in front of some other back-end web server.
Resolving the problem
There are 2 possible solutions to this problem:
1) Fix the KeepAlive timeout mismatch by increasing the KeepAliveTimeout value in the back-end web server. The KeepAliveTimeout value for the back-end web server should be at least double or triple whatever the IBM HTTP Server is using for KeepAliveTimeout. For example, if the KeepAliveTimeout for IBM HTTP Server is 15 seconds, then the back-end web server should be configured to use KeepAliveTimeout of 30 or 45 seconds.
2) Disable KeepAlive in IBM HTTP Server, by adding this directive into your IBM HTTP Server config (httpd.conf):
NOTE: Depending on load / network, disabling KeepAlive can be a potentially expensive hit on efficiency and performance since IBM HTTP Server will establish a new connection for every request (much more overhead involved). So, Fixing the KeepAlive timeout mismatch is preferable over disabling KeepAlive altogether.