Accept-Language Issue

Andrey Nepomnyaschih rednasy at gmail.com
Thu Jul 1 22:54:39 CEST 2010


Hello,

Can somebody give me a hint for what am I doing wrong with my setup. I have
Zope instance that is proxied by nginx (doing address rewriting) that I want
to be cached by varnish, but as soon as I configure Zope to add
Accept-Language to Vary header, varnish starts closing connection when asked
for object from Zope without returning any data. I'm using default.vcl

Using tcpdump doesn't reveal anything useful, the only difference is
Accept-Language value in Vary header.

Request that works:

# GET -H "Host: hostname.domain.tld" -Used http://hostname.domain.tld
GET http://hostname.domain.tld
Host: hostname.domain.tld
User-Agent: lwp-request/5.834 libwww-perl/5.836

200 OK
Wide character in print at /usr/local/bin/GET line 439.
Cache-Control: max-age=0, s-maxage=0, private, must-revalidate
Connection: close
Date: Thu, 01 Jul 2010 20:30:22 GMT
Via: 1.1 varnish
Age: 0
ETag: ||Plone Default||0|181||||355004
Server: nginx/0.7.67
Vary: User-Agent
Content-Language: en
Content-Length: 5485
Content-Type: text/html;charset=utf-8
Expires: Mon, 03 Jul 2000 20:30:22 GMT
Client-Date: Thu, 01 Jul 2010 20:30:22 GMT
Client-Peer: 82.103.128.123:80
Client-Response-Num: 1
Content-Base: http://hostname.domain.tld/plonesite/front-page
Imagetoolbar: no
Link: <http://hostname.domain.tld/plonesite/front-page>; rel="kss-base-url"
Link: <
http://hostname.domain.tld/plonesite/portal_kss/Plone%20Default/at-cachekey6690.kss>;
rel="kinetic-stylesheet"; type="text/css"
Link: <http://hostname.domain.tld/plonesite/favicon.ico>; rel="shortcut
icon"; type="image/x-icon"
Link: <http://hostname.domain.tld/plonesite>; rel="home"; title="Front page"
Link: <http://hostname.domain.tld/plonesite/sitemap>; rel="contents";
title="Site Map"
Link: <http://hostname.domain.tld/plonesite/search_form>; rel="search";
title="Search this site"
Title: Plone Site!
X-Cache-Headers-Set-By: CachingPolicyManager:
/plonesite/caching_policy_manager
X-Caching-Rule-Id: plone-content-types
X-Header-Set-Id: cache-in-memory
X-Meta-Generator: Plone - http://plone.org
X-Pagecache: MISS
X-UA-Compatible: IE=edge
X-Varnish: 1366563744

Results in the following request to nginx:

2010/07/01 22:30:22.196300 127.0.0.1:25266 -> 127.0.0.1:8080 [AP]
GET / HTTP/1.1.
Host: hostname.domain.tld.
User-Agent: lwp-request/5.834 libwww-perl/5.836.
X-Forwarded-For: 82.103.128.123.
X-Varnish: 1366563744.

And the following reply from nginx:

T 2010/07/01 22:30:22.267204 127.0.0.1:8080 -> 127.0.0.1:25266 [AP]
HTTP/1.1 200 OK.
Server: nginx/0.7.67.
Date: Thu, 01 Jul 2010 20:30:22 GMT.
Content-Type: text/html;charset=utf-8.
Connection: keep-alive.
X-Pagecache: MISS.
Content-Length: 5485.
Content-Language: en.
X-Cache-Headers-Set-By: CachingPolicyManager:
/plonesite/caching_policy_manager.
Expires: Mon, 03 Jul 2000 20:30:22 GMT.
Vary: User-Agent.
ETag: ||Plone Default||0|181||||355004.
X-Caching-Rule-Id: plone-content-types.
Cache-Control: max-age=0, s-maxage=0, private, must-revalidate.
X-Header-Set-Id: cache-in-memory.

Request that doesn't work:

[root at rain /usr/local/etc/varnish]# GET -H "Host: hostname.domain.tld" -Used
http://hostname.domain.tld
GET http://hostname.domain.tld
Host: hostname.domain.tld
User-Agent: lwp-request/5.834 libwww-perl/5.836

500 Server closed connection without sending any data back
Content-Type: text/plain
Client-Date: Thu, 01 Jul 2010 20:27:54 GMT
Client-Warning: Internal response

Results in the following request to nginx:

2010/07/01 22:27:54.507294 127.0.0.1:50795 -> 127.0.0.1:8080 [AP]
GET / HTTP/1.1.
Host: hostname.domain.tld.
User-Agent: lwp-request/5.834 libwww-perl/5.836.
X-Forwarded-For: 82.103.128.123.
X-Varnish: 1656652273.

And the following reply from nginx:

2010/07/01 22:27:54.573671 127.0.0.1:8080 -> 127.0.0.1:50795 [AP]
HTTP/1.1 200 OK.
Server: nginx/0.7.67.
Date: Thu, 01 Jul 2010 20:27:54 GMT.
Content-Type: text/html;charset=utf-8.
Connection: keep-alive.
X-Pagecache: MISS.
Content-Length: 5485.
Content-Language: en.
X-Cache-Headers-Set-By: CachingPolicyManager:
/plonesite/caching_policy_manager.
Expires: Mon, 03 Jul 2000 20:27:54 GMT.
Vary: User-Agent Accept-Language.
ETag: ||Plone Default||0|180||||355004.
X-Caching-Rule-Id: plone-content-types.
Cache-Control: max-age=0, s-maxage=0, private, must-revalidate.
X-Header-Set-Id: cache-in-memory.

Kind Regards,
Andrey Nepomnyaschih
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20100701/cde0dc1c/attachment-0003.html>


More information about the varnish-misc mailing list