Hello,<div><br></div><div>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 </div>
<div><br></div><div>Using tcpdump doesn't reveal anything useful, the only difference is Accept-Language value in Vary header.</div><div><br></div><div>Request that works:</div><div><br></div><div><div># GET -H "Host: hostname.domain.tld" -Used <a href="http://hostname.domain.tld">http://hostname.domain.tld</a></div>
<div>GET <a href="http://hostname.domain.tld">http://hostname.domain.tld</a></div><div>Host: hostname.domain.tld</div><div>User-Agent: lwp-request/5.834 libwww-perl/5.836</div></div><div><br></div><div><div>200 OK</div><div>
Wide character in print at /usr/local/bin/GET line 439.</div><div>Cache-Control: max-age=0, s-maxage=0, private, must-revalidate</div><div>Connection: close</div><div>Date: Thu, 01 Jul 2010 20:30:22 GMT</div><div>Via: 1.1 varnish</div>
<div>Age: 0</div><div>ETag: ||Plone Default||0|181||||355004</div><div>Server: nginx/0.7.67</div><div>Vary: User-Agent</div><div>Content-Language: en</div><div>Content-Length: 5485</div><div>Content-Type: text/html;charset=utf-8</div>
<div>Expires: Mon, 03 Jul 2000 20:30:22 GMT</div><div>Client-Date: Thu, 01 Jul 2010 20:30:22 GMT</div><div>Client-Peer: <a href="http://82.103.128.123:80">82.103.128.123:80</a></div><div>Client-Response-Num: 1</div><div>Content-Base: <a href="http://hostname.domain.tld/plonesite/front-page">http://hostname.domain.tld/plonesite/front-page</a></div>
<div>Imagetoolbar: no</div><div>Link: <<a href="http://hostname.domain.tld/plonesite/front-page">http://hostname.domain.tld/plonesite/front-page</a>>; rel="kss-base-url"</div><div>Link: <<a href="http://hostname.domain.tld/plonesite/portal_kss/Plone%20Default/at-cachekey6690.kss">http://hostname.domain.tld/plonesite/portal_kss/Plone%20Default/at-cachekey6690.kss</a>>; rel="kinetic-stylesheet"; type="text/css"</div>
<div>Link: <<a href="http://hostname.domain.tld/plonesite/favicon.ico">http://hostname.domain.tld/plonesite/favicon.ico</a>>; rel="shortcut icon"; type="image/x-icon"</div><div>Link: <<a href="http://hostname.domain.tld/plonesite">http://hostname.domain.tld/plonesite</a>>; rel="home"; title="Front page"</div>
<div>Link: <<a href="http://hostname.domain.tld/plonesite/sitemap">http://hostname.domain.tld/plonesite/sitemap</a>>; rel="contents"; title="Site Map"</div><div>Link: <<a href="http://hostname.domain.tld/plonesite/search_form">http://hostname.domain.tld/plonesite/search_form</a>>; rel="search"; title="Search this site"</div>
<div>Title: Plone Site!</div><div>X-Cache-Headers-Set-By: CachingPolicyManager: /plonesite/caching_policy_manager</div><div>X-Caching-Rule-Id: plone-content-types</div><div>X-Header-Set-Id: cache-in-memory</div><div>X-Meta-Generator: Plone - <a href="http://plone.org">http://plone.org</a></div>
<div>X-Pagecache: MISS</div><div>X-UA-Compatible: IE=edge</div><div>X-Varnish: 1366563744</div></div><div><br></div><div>Results in the following request to nginx:</div><div><br></div><div><div>2010/07/01 22:30:22.196300 <a href="http://127.0.0.1:25266">127.0.0.1:25266</a> -> <a href="http://127.0.0.1:8080">127.0.0.1:8080</a> [AP]</div>
<div>GET / HTTP/1.1.</div><div>Host: hostname.domain.tld.</div><div>User-Agent: lwp-request/5.834 libwww-perl/5.836.</div><div>X-Forwarded-For: 82.103.128.123.</div><div>X-Varnish: 1366563744.</div></div><div><br></div><div>
And the following reply from nginx:</div><div><br></div><div><div>T 2010/07/01 22:30:22.267204 <a href="http://127.0.0.1:8080">127.0.0.1:8080</a> -> <a href="http://127.0.0.1:25266">127.0.0.1:25266</a> [AP]</div><div>HTTP/1.1 200 OK.</div>
<div>Server: nginx/<a href="http://0.7.67.">0.7.67.</a></div><div>Date: Thu, 01 Jul 2010 20:30:22 GMT.</div><div>Content-Type: text/html;charset=utf-8.</div><div>Connection: keep-alive.</div><div>X-Pagecache: MISS.</div><div>
Content-Length: 5485.</div><div>Content-Language: en.</div><div>X-Cache-Headers-Set-By: CachingPolicyManager: /plonesite/caching_policy_manager.</div><div>Expires: Mon, 03 Jul 2000 20:30:22 GMT.</div><div>Vary: User-Agent.</div>
<div>ETag: ||Plone Default||0|181||||355004.</div><div>X-Caching-Rule-Id: plone-content-types.</div><div>Cache-Control: max-age=0, s-maxage=0, private, must-revalidate.</div><div>X-Header-Set-Id: cache-in-memory.</div></div>
<div><br></div><div>Request that doesn't work:</div><div><br></div><div><div>[root@rain /usr/local/etc/varnish]# GET -H "Host: hostname.domain.tld" -Used <a href="http://hostname.domain.tld">http://hostname.domain.tld</a></div>
<div>GET <a href="http://hostname.domain.tld">http://hostname.domain.tld</a></div><div>Host: hostname.domain.tld</div><div>User-Agent: lwp-request/5.834 libwww-perl/5.836</div><div><br></div><div>500 Server closed connection without sending any data back</div>
<div>Content-Type: text/plain</div><div>Client-Date: Thu, 01 Jul 2010 20:27:54 GMT</div><div>Client-Warning: Internal response</div></div><div><br></div><div>Results in the following request to nginx:</div><div><br></div>
<div><div>2010/07/01 22:27:54.507294 <a href="http://127.0.0.1:50795">127.0.0.1:50795</a> -> <a href="http://127.0.0.1:8080">127.0.0.1:8080</a> [AP]</div><div>GET / HTTP/1.1.</div><div>Host: hostname.domain.tld.</div><div>
User-Agent: lwp-request/5.834 libwww-perl/5.836.</div><div>X-Forwarded-For: 82.103.128.123.</div><div>X-Varnish: 1656652273.</div></div><div><br></div><div>And the following reply from nginx:</div><div><br></div><div><div>
2010/07/01 22:27:54.573671 <a href="http://127.0.0.1:8080">127.0.0.1:8080</a> -> <a href="http://127.0.0.1:50795">127.0.0.1:50795</a> [AP]</div><div>HTTP/1.1 200 OK.</div><div>Server: nginx/<a href="http://0.7.67.">0.7.67.</a></div>
<div>Date: Thu, 01 Jul 2010 20:27:54 GMT.</div><div>Content-Type: text/html;charset=utf-8.</div><div>Connection: keep-alive.</div><div>X-Pagecache: MISS.</div><div>Content-Length: 5485.</div><div>Content-Language: en.</div>
<div>X-Cache-Headers-Set-By: CachingPolicyManager: /plonesite/caching_policy_manager.</div><div>Expires: Mon, 03 Jul 2000 20:27:54 GMT.</div><div>Vary: User-Agent Accept-Language.</div><div>ETag: ||Plone Default||0|180||||355004.</div>
<div>X-Caching-Rule-Id: plone-content-types.</div><div>Cache-Control: max-age=0, s-maxage=0, private, must-revalidate.</div><div>X-Header-Set-Id: cache-in-memory.</div></div><div><br></div><div>Kind Regards,</div><div>Andrey Nepomnyaschih</div>