Problem with concatenated response headers with 1.1.2

John Jensen john at jensen.net
Sun Mar 23 00:15:04 CET 2008


Hello,

I have a curious problem with Varnish 1.1.2 response headers on Ubuntu
Gutsy.  I think it is best summarized with some telnet excerpts:

Telnet to backend server:

john at rush:~> telnet localhost 8080
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /static/images/7/6/9/4257486967_large_processed.jpg HTTP/1.1

HTTP/1.1 200
Content-type: image/jpeg
Content-Length: 8453
Last-Modified: Sat, 23 Feb 2008 05:44:28 GMT
Date: Sat, 22 Mar 2008 23:03:30 GMT
Server: CherryPy/3.0.1

<snipped binary data>

Now when I try it through varnish I get the following messed up status
header:

john at rush:~> telnet localhost 6081
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /static/images/7/6/9/4257486967_large_processed.jpg HTTP/1.1

HTTP/1.1 200 Content-type: image/jpeg
Last-Modified: Sat, 23 Feb 2008 05:44:28 GMT
Server: CherryPy/3.0.1
Content-Length: 8453
Date: Sat, 22 Mar 2008 23:05:26 GMT
X-Varnish: 768656770
Age: 0
Via: 1.1 varnish
Connection: keep-alive

<snipped binary data>

You will see the issue in the HTTP/1.200 status line.  I've played with the
configuration of the backend server application, and no matter what header
is placed first, it is concatenated to the status line in Varnish's
response.

The vcl.conf is very simple, pretty well just this:

sub vcl_recv {

    if (req.request == "GET" && req.url ~ "\.(png|gif|jpg|swf|css|js)$") {
        lookup;
    }

    if (req.request == "GET" && req.http.cookie) {
        remove obj.http.Set-Cookie;
        lookup;
    }

    if (req.request == "POST") {
        pipe;
    }

    if (req.http.Accept-Encoding) {
        if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|tbz|mp3|ogg)$") {
           remove req.http.Accept-Encoding;
        } elsif (req.http.Accept-Encoding ~ "gzip") {
           set req.http.Accept-Encoding = "gzip";
        } elsif (req.http.Accept-Encoding ~ "deflate") {
           set req.http.Accept-Encoding = "deflate";
        } else {
           remove req.http.Accept-Encoding;
        }
    }

    pass
}

I've looked at this a half-dozen ways and can't see what the problem is.
Any ideas?

John




-- 
John Jensen
john at jensen.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20080322/53359939/attachment-0001.html>


More information about the varnish-misc mailing list