Re: Header Length Limits in mode http

From: Timothy Garnett <tgarnett#panjiva.com>
Date: Fri, 10 Sep 2010 15:43:50 -0400


Hi Andrew,

Thanks for the response. My nginx configured with large buffers and I've verified that problem still occurs when targeting haproxy directly (skipping nginx) and does not occur when nginx targets mongrels directly skipping haproxy. So it does appear to be haproxy that's returning the 400 status.

Some test cases:
Very Long URL (~6500 characters), No Referrer => 400 returned Long URL (~4000 characters), Short Referrer => no problem Long URL (~4000 characters), Long Referrer (4000 characters) => 400 returned Short URL, Long Referrer (4000 characters) => no problem So the issue seems to be related to some combination of the size of the request and headers.

Tim

On Fri, Sep 10, 2010 at 1:28 PM, Andrew Farmer <andrew#moovweb.com> wrote:

> Hi Timothy,
>
> I'm not an expert on haproxy but I have had an issue with nginx and large
> headers. (Cookies in particular). If this is the same issue you would see a
> problem about headers being too large in your nginx error log. If that's the
> case, these nginx parameters would set the header buffer to be huge and fix
> the issue:
> proxy_buffer_size 128k;
> proxy_buffers 4 256k;
> proxy_busy_buffers_size 256k;
>
> Also I am a little confused about your question because you mention URLs
> are large and headers are too large. I would recommend trying to reproduce
> the issue with a very long URL but no referrer and a very long referrer but
> short URL.
>
> Hope this helps.
>
>
> On Fri, Sep 10, 2010 at 10:07 AM, Timothy Garnett <tgarnett#panjiva.com>wrote:
>
>> Hi all,
>>
>> We use a nginx -> haproxy (1.3.20 currently) -> mongrels setup to serve
>> our website and recently we noticed an issue where haproxy is returning a
>> 400 error for requests with very long headers (for us typically long url,
>> long referrer, or the combination of both). I checked the change logs and
>> didn't see anything that might address this in newer versions. While I
>> haven't narrowed down the exact limit yet it's around 6500 bytes. This
>> occurs only when the config file has mode http, in mode tcp the request goes
>> through fine. So perhaps related to some buffer limit in the http parsing?
>> If so is the limit documented some where and is there a setting to increase
>> it? While long urls are generally not a good idea, we don't always have
>> full control over the referrer and for a couple of reasons we'd like to
>> support very long urls in a few parts of our site.
>>
>> TIm
>>
>
>
>
> --
> Andrew Farmer
> Moovweb
> 110 Sutter Street, Suite 200
> San Francisco, CA 94104
> 510.468.8372
> http://moovweb.com
> http://moo.vn/andrew_calendar
>
>
>
Received on 2010/09/10 21:43

This archive was generated by hypermail 2.2.0 : 2010/09/10 22:00 CEST