Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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      http://127.0.0.1:8001/context1
ProxyPass       /context2      http://127.0.0.1:8002/context2
ProxyPreserveHost Off
ProxyErrorOverride Off
</IfModule>

Thanks in advance

  • httpd 2.2.22 (Win32) mod_ssl
  • tomcat 7.25
  • windows 7 64-bits
share|improve this question

1 Answer 1

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

 
discard

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.