Hi,
This error typically appears when Apache web server does not receive a valid HTTP response from the upstream server, which in this case is your Tomcat web application. If you are not using Apache HTTP Server and your are using only Tomcat the error may be generated due the following reasons:
- The Tomcat threads are timing out
- A network device is blocking the request, perhaps as some sort of connection timeout or DoS attack prevention system, or maybe a firewalll
- Tomcat may have crashed
If you are using Apache, the solution is simple. Just edit the httpd.conf file increasing the Timeout and ProxyTimeout values and adding the ProxyBadHeader parameter.
Timeout 3000
ProxyTimeout 3000
ProxyBadHeader Ignore
More information you can find on Apache website (http://httpd.apache.org/docs/2.2/mod/mod_proxy.html)
Also, please tell us in which configuration this error apears (Apache-Tomcat, only Tomcat, Nginx-Tomcat, etc.)