Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an httpd server proxying the requests to 2 different tomcat servers. One of my server handles the authentication and returns a specific http error code 521 when the user already have a running session.

My issue is httpd automatically maps this 521 error code to a 500 (internal server error) and then my client can not handle it properly.

I have tried to disable ProxyErrorOverride, to remove the /error/HTTP_INTERNAL_SERVER_ERROR.html.var but it does not changes anything.

How can I ask httpd to not change anything to the proxied message?

<IfModule proxy_module>
ProxyPass       /context1
ProxyPass       /context2
ProxyPreserveHost Off
ProxyErrorOverride Off

Thanks in advance

  • httpd 2.2.22 (Win32) mod_ssl
  • tomcat 7.25
  • windows 7 64-bits
share|improve this question
up vote 2 down vote accepted

521 isn't a valid HTTP response code, and Apache would be violating the HTTP specification by returning it.

Take a look at Apache's error log - it might actually be choking on the response code that it's getting from the backend and throwing an error to the client, not mapping the 5xx code to 500.

I'd strongly suggest against misusing HTTP response codes like this, but HAProxy or Varnish both have the ability to act as a 'dumb pipe', which might fit your needs.

share|improve this answer
ok, then if there is no way of doing that with httpd I'll reconsider the fact of using the http error code to advice the client of a specific error. Thanks – ZNK - M Nov 19 '12 at 13:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.