The error Connection refused indicates that the proxy cannot connect to the backend server to which it attempts to relay the request. There are several possible causes for this issue:
The backend web server is not responding, either because it is:
overwhelmed with requests and not accepting further connections (most likely explanation).
There is a networking problem between the proxy and backend. For example, a faulty interface configuration, faulty network devices, or a firewall. The Connection refused error is different from a complete failure to locate the backend (due to routing errors or missing DNS entries, for example). It means the backend host can be reached but cannot accept a connection at the specified port.
The error pass request body failed indicates that the proxy made a successful connection to the backend server and sent the request headers (which generally fit in the first packet). But, the connection for the body of the request (generally a POST request) is either dropped, or the backend server stopped reading the incoming data. There are several possible causes for this issue:
The backend web server crashed or hung while reading the request.
The backend web server stalled and timed out while processing data from a long body, so the request could not be completed.
The connection was closed prematurely, perhaps due to faulty networking or buggy implementations.
When troubleshooting, it is important to note the frequency of these messages and messages in the logs.
If every proxied request is failing to connect, the backend server is not running or a network misconfiguration is blocking access. You must test connectivity more directly by using a tool such as telnet to attempt to connect from the proxy to the backend. This can be used repeatedly to verify the problem and progress in fixing it.
If connection failures come in clusters, then a likely explanation is that the backend server is receiving more requests than it is able to accept (or configured to accept).
Sporadic connection failures may be signs of impending hardware failure.
Errors with proxy requests that are in flight or pass request body failed tend to be more subtle. Here are some things to try:
For HTTP proxies, try disabling reuse of proxy-to-backend connections (such as keepalive). You can do this by setting the proxy-nokeepalive variable in your configuration:
SetEnv proxy-nokeepalive 1
Note: If the problem disappears with this change, there is likely a subtle problem related to handling keepalive timeouts on one end of the connection or in between. Disabling keepalives may result in changes to proxy performance; you will need to test your particular systems to determine any impact. In most situations where proxy and backend are close on the network, the difference will be negligible, so it's best to make this change if it solves the problem.