nginx 400 status code sometimes reported as 502 in haproxy

From: Jean-Baptiste Quenot <jbq#caraldi.com>
Date: Mon, 6 Jul 2009 12:31:07 +0200


Hi there,

In my setup an incoming HTTP requests follows the chain Varnish -> Haproxy -> Nginx. Haproxy is configured to have Nginx as one of the backends.
I have an interesting problem: some client browsers have a too big cookie in the request header, and Nginx is thus issuing a 400 Bad Request. As a result, this 400 error code is propagated to Haproxy in most cases, but in some occasions Haproxy reports a 502 Bad Gateway. In the attached Haproxy log output, haproxy reports mostly 400 errors, but in some cases it is reporting 502, whereas Nginx always reports 400.

It's a bit annoying for me, since I carefully monitor all 5xx status codes, as it usually means there is something wrong on the server side.

I'm using haproxy 1.3.15.9 on Ubuntu 9.04

Any idea?

-- 
Jean-Baptiste Quenot
http://jbq.caraldi.com/

Received on 2009/07/06 12:31

This archive was generated by hypermail 2.2.0 : 2009/07/06 12:45 CEST