HTTP 400 returned for a HTTP request over 28 headers?

Anderson Brown andersonbrown8 at gmail.com
Tue Aug 31 15:52:05 CEST 2010


Thanks Per!   Looking at
http://varnish-cache.org/docs/trunk/reference/varnishd.html; it seems I just
need to add this in /etc/sysconfig/varnish:

DAEMON_OPTS="-a :7081 \
             -T localhost:7082 \
             -f /etc/varnish/default.vcl \
             -p http_headers=128 \                 ### NOT WORK?
             -p cli_buffer=8192 \                  ### WORKS OK
             -u varnish -g varnish \
             -s file,/var/lib/varnish/varnish_storage.bin,1G"

However, when I try to restart:

root at machine>/etc/init.d/varnish restart
Stopping varnish HTTP accelerator:                         [  OK  ]
Starting varnish HTTP accelerator:                         [FAILED]

I see nothing in /var/log/messages nor in varnishlog.

root at machine>varnishd -V
varnishd (varnish-2.0.6)
Copyright (c) 2006-2009 Linpro AS / Verdens Gang AS

Am I using an older version?  Just did the varnish install via yum-EPEL.

Thanks
Anderson


On Mon, Aug 30, 2010 at 5:14 PM, Per Buer <perbu at varnish-software.com>wrote:

> On Mon, Aug 30, 2010 at 7:38 PM, Anderson Brown <andersonbrown8 at gmail.com>wrote:
>
>>
>> Not sure what I'm missing here; but it seems like Varnish is returning
>> HTTP 400 when I have an HTTP request with over 28 headers.  Is this a
>> configuration limit?
>>
>
>
> Yes. From varnishd(1), parameters:
>
> http_headers
>
> Units: header lines Default: 64
>
> Maximum number of HTTP headers we will deal with. This space is
> preallocated in sessions and workthreads only objects allocate only space
> for the headers they store.
>
>
>>
>>
>> ------------------------------------------------------------------------------------------------------
>>
>> *Exhibit A:  [HTTP 200 OK] 28 Request Headers (including the GET and HOST
>> headers):
>> *
>> root at machine>telnet localhost 7081
>> Trying 127.0.0.1...
>> Connected to localhost.
>> Escape character is '^]'.
>> GET / HTTP/1.1
>> Host: localhost:7081
>> a: 1
>> b: 2
>> c: 3
>> d: 4
>> e: 5
>> f: 6
>> g: 7
>> h: 8
>> i: 9
>> j: 10
>> k: 11
>> l: 12
>> m: 13
>> n: 14
>> o: 15
>> p: 16
>> q: 17
>> r: 18
>> s: 19
>> t: 20
>> u: 21
>> v: 22
>> w: 23
>> x: 24
>> y: 25
>> z: 26
>>
>> HTTP/1.1 200 OK
>> Server: Apache-Coyote/1.1
>> Set-Cookie: JSESSIONID=7F2827B4D4327E2AFC10E13D26B415EC; Path=/
>> Content-Type: text/html;charset=ISO-8859-1
>> Content-Length: 5
>> Date: Mon, 30 Aug 2010 17:30:28 GMT
>> X-Varnish: 1696828212
>> Age: 0
>> Via: 1.1 varnish
>> Connection: keep-alive
>>
>>
>> ------------------------------------------------------------------------------------------------------
>>
>> *Exhibit B:  [HTTP 400 BAD REQUEST] 29 Request Headers (including the GET
>> and HOST headers):
>> *
>> root at machine>telnet localhost 7081
>> Trying 127.0.0.1...
>> Connected to localhost.
>> Escape character is '^]'.
>> GET / HTTP/1.1
>> Host: localhost:7081
>> a: 1
>> b: 2
>> c: 3
>> d: 4
>> e: 5
>> f: 6
>> g: 7
>> h: 8
>> i: 9
>> j: 10
>> k: 11
>> l: 12
>> m: 13
>> n: 14
>> o: 15
>> p: 16
>> q: 17
>> r: 18
>> s: 19
>> t: 20
>> u: 21
>> v: 22
>> w: 23
>> x: 24
>> y: 25
>> z: 26
>> aa: 1
>>
>> *HTTP/1.1 400 Bad Request
>> *Server: Varnish
>> Retry-After: 0
>> Content-Type: text/html; charset=utf-8
>> Content-Length: 464
>> Date: Mon, 30 Aug 2010 17:30:34 GMT
>> X-Varnish: 1696828213
>> Age: 0
>> Via: 1.1 varnish
>> Connection: close
>>
>>
>> <?xml version="1.0" encoding="utf-8"?>
>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>> <html>
>>  <head>
>>    <title>400 Bad Request</title>
>>  </head>
>>  <body>
>>    <h1>Error 400 Bad Request</h1>
>>    <p>Bad Request</p>
>>    <h3>Guru Meditation:</h3>
>>    <p>XID: 1696828213</p>
>>    <hr>
>>    <address>
>>       <a href="http://www.varnish-cache.org/">Varnish cache server</a>
>>    </address>
>>  </body>
>> </html>
>> Connection closed by foreign host.
>>
>> _______________________________________________
>> varnish-dev mailing list
>> varnish-dev at varnish-cache.org
>> http://lists.varnish-cache.org/mailman/listinfo/varnish-dev
>>
>
>
>
> --
> Per Buer,  Varnish Software
> Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / skype: per.buer
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20100831/d71a1045/attachment-0003.html>


More information about the varnish-dev mailing list