Application error passthru when using apache mod_proxy

Posted by user303442 on Stack Overflow See other posts from Stack Overflow or by user303442
Published on 2010-03-28T04:26:11Z Indexed on 2010/03/28 4:33 UTC
Read the original article Hit count: 332

Filed under:
|

Heyas. I'm using mod_proxy with apache2 provide vhost ability to multiple servlet apps running on the local machine. It works fine, for the most part. Requests come into apache then are directed to the application bound on a port on localhost. The app receives the request and responds, which is delivered back to the client by apache.

The problem I'm having is that the application delivers 500's on errors, and mod_proxy stomps on them. Often these errors are caused in a ajax request and the error is handled in client side javascript. For example, a call to a server side createObject(name) might throw a NameNotUniqueException , which is delivered back as a 500. The client javascript might then display an appropriate error message.

When an error is thrown by the application (resulting in a 500 response to mod_proxy), then apache stomps the error message and returns

500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

.. the stock apache server side error message.

I want mod_proxy to pass the original 500 back through to the client. Is there a directive I've missed which prevents clobbering of the 500?

TIA

© Stack Overflow or respective owner

Related posts about apache

Related posts about mod-proxy