haproxy streaming response code 400

1.3k views Asked by At

I have a REST API sitting on openshift behind haproxy which returns the response code 400 if a user doesn't enter the required GET parameter. As a result haproxy doesn't work at all and throws the following error:

Server express/local-gear is DOWN, reason: Layer7 wrong status, code: 400, 
info: "HTTP status check returned code <3C>400<3E>", check duration: 1ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.

Returning the response code 200 with an error works fine but it just feels wrong...

Is there a way to achieve sending a 400 response through haproxy? Or is this just to do with the check?

1

There are 1 answers

0
Graham Dumpleton On BEST ANSWER

The message appears to just be the haproxy health check failing. I believe you would either have to add a special handler for the URL which the haproxy health check request is pinging that returns 200, or if that URL serves a different purpose, change the haproxy configuration to use a different URL which does always returns 200. For some discussion see: