I have an Apache proxy to a custom Java app that returns status code 460 on a specific error condition. When this reaches the client, apache is incorrectly turning it into a 500 status code, although other ones (404, 403) get sent through correctly.
Here is my virtual host:
<VirtualHost *:80>
ServerName api.acme.org
ProxyPass / http://service.internal:10001/
ProxyPassReverse / http://service.internal:10001/
</VirtualHost>
And the log entry, which shows the correct code:
10.0.0.2 - - [21/Nov/2010:23:20:17 +0000] "GET /session/abc123/touch HTTP/1.1" 460 1379
Any idea what is causing this?
Update: Here is the output to the headers from curl:
Direct to service:
# curl -I http://service.internal:10001/session/abc123/touch
HTTP/1.1 460
Content-length: 1388
Proxied:
# curl -O http://api.acme.org/session/abc123/touch
HTTP/1.1 500 Internal Server Error
Date: Mon, 22 Nov 2010 17:24:51 GMT
Content-length: 1388
Connection: close
Content-Type: text/plain; charset=UTF-8
Seems Apache has its own idea about what the error should be!
The problem may be a bug in httpd. Fixed in 2.2.18.
https://bugzilla.redhat.com/show_bug.cgi?id=900827
On the contrary, it appears that Apache IS returning the correct error code. The log shows Apache returning 460, but your browser may be interpreting it differently (because 460 is not defined in an RFC). There's an easy way to check this; from a Linux machine (it could even be the server itself), try running the following:
If this is returning 460, than it would appear to be something to do with the browsers (i.e., an unknown status code means a server error). If not, you may want to consider trying this WITHOUT using mod_proxy--i.e., by accessing the URL directly.
The mod_proxy don't know what status 460 mean and don't know how to react.
In contrast, when it sees status 200, it forward. When is sees 403, 404 and some other, it knows what to do.