1

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
poussma
  • 150
  • 1
  • 1
  • 6

1 Answers1

2

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.

Shane Madden
  • 112,982
  • 12
  • 174
  • 248
  • 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 – poussma Nov 19 '12 at 13:29