Ken, Laurence thank you.<div><br>It was indeed my typo.<br><br><div class="gmail_quote">On Thu, Jul 1, 2010 at 5:37 PM, Laurence Rowe <span dir="ltr">&lt;<a href="mailto:l@lrowe.co.uk" target="_blank">l@lrowe.co.uk</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Check that you do have the comma in Plone&#39;s caching control panel. I can imagine it being an easy typo to make.<div>

<br></div><div>There are many unique variations of Accept-Language headers, so be careful. I&#39;ve used this before in vcl_recv to normalise the incoming request:</div>
<div><br></div><div><div>  # We only care about the language in the I18N_LANGUAGE cookie</div><div>  if (req.http.Cookie ~ &quot;(^|.*; )I18N_LANGUAGE=&quot;) {</div><div>    set req.http.Accept-Language = regsub(req.http.Cookie, &quot;(^|.*; )I18N_LANGUAGE=([^;]*)(; .*|$)&quot;, &quot;\2&quot;);</div>


<div>    # XXX need to work out the proper way to match &quot; here, e.g. &quot;en&quot;</div><div>    set req.http.Accept-Language = regsub(req.http.Accept-Language, &quot;^.(.*).$&quot;, &quot;\1&quot;);</div><div>  } else {</div>


<div>    set req.http.Accept-Language = &quot;en&quot;;</div><div>  }</div></div><div><br></div><font color="#888888"><div>Laurence</div></font><div><div></div><div><div><br><div class="gmail_quote">On 1 July 2010 22:04, Ken Brownfield <span dir="ltr">&lt;<a href="mailto:kb%2Bvarnish@slide.com" target="_blank">kb+varnish@slide.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">I do notice that the Vary header is malformed:<div><br></div><div><div><div>
Vary: User-Agent Accept-Language</div><div><br></div></div><div>It should be comma-separated AFAIK.  Also, all of the lines from your last header dump have appended periods... not sure that&#39;s the actual output or just a paste glitch.</div>


<div><br></div><div>Perhaps Varnish is being very strict about malformed headers and dumping the connection immediately.  Which is probably a good thing, if true.</div><div>
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:&#39;Minion Pro&#39;;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:&#39;Minion Pro&#39;;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">


<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:&#39;Minion Pro&#39;;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">


<div>-- </div><div>Ken</div></div></span></div></span></span>
</div>


<br><div><div><div></div><div><div>On Jul 1, 2010, at 1:54 PM, Andrey Nepomnyaschih wrote:</div><br></div></div><blockquote type="cite"><div><div></div><div>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&#39;m using default.vcl </div>



<div><br></div><div>Using tcpdump doesn&#39;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 &quot;Host: hostname.domain.tld&quot; -Used <a href="http://hostname.domain.tld/" target="_blank">http://hostname.domain.tld</a></div>



<div>GET <a href="http://hostname.domain.tld/" target="_blank">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/" target="_blank">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" target="_blank">http://hostname.domain.tld/plonesite/front-page</a></div>
<div>Imagetoolbar: no</div><div>Link: &lt;<a href="http://hostname.domain.tld/plonesite/front-page" target="_blank">http://hostname.domain.tld/plonesite/front-page</a>&gt;; rel=&quot;kss-base-url&quot;</div><div>Link: &lt;<a href="http://hostname.domain.tld/plonesite/portal_kss/Plone%20Default/at-cachekey6690.kss" target="_blank">http://hostname.domain.tld/plonesite/portal_kss/Plone%20Default/at-cachekey6690.kss</a>&gt;; rel=&quot;kinetic-stylesheet&quot;; type=&quot;text/css&quot;</div>



<div>Link: &lt;<a href="http://hostname.domain.tld/plonesite/favicon.ico" target="_blank">http://hostname.domain.tld/plonesite/favicon.ico</a>&gt;; rel=&quot;shortcut icon&quot;; type=&quot;image/x-icon&quot;</div><div>Link: &lt;<a href="http://hostname.domain.tld/plonesite" target="_blank">http://hostname.domain.tld/plonesite</a>&gt;; rel=&quot;home&quot;; title=&quot;Front page&quot;</div>



<div>Link: &lt;<a href="http://hostname.domain.tld/plonesite/sitemap" target="_blank">http://hostname.domain.tld/plonesite/sitemap</a>&gt;; rel=&quot;contents&quot;; title=&quot;Site Map&quot;</div><div>Link: &lt;<a href="http://hostname.domain.tld/plonesite/search_form" target="_blank">http://hostname.domain.tld/plonesite/search_form</a>&gt;; rel=&quot;search&quot;; title=&quot;Search this site&quot;</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/" target="_blank">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/" target="_blank">127.0.0.1:25266</a> -&gt; <a href="http://127.0.0.1:8080/" target="_blank">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/" target="_blank">127.0.0.1:8080</a> -&gt; <a href="http://127.0.0.1:25266/" target="_blank">127.0.0.1:25266</a> [AP]</div>


<div>HTTP/1.1 200 OK.</div>
<div>Server: nginx/<a href="http://0.7.67./" target="_blank">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&#39;t work:</div><div><br></div><div><div>[root@rain /usr/local/etc/varnish]# GET -H &quot;Host: hostname.domain.tld&quot; -Used <a href="http://hostname.domain.tld/" target="_blank">http://hostname.domain.tld</a></div>



<div>GET <a href="http://hostname.domain.tld/" target="_blank">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/" target="_blank">127.0.0.1:50795</a> -&gt; <a href="http://127.0.0.1:8080/" target="_blank">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/" target="_blank">127.0.0.1:8080</a> -&gt; <a href="http://127.0.0.1:50795/" target="_blank">127.0.0.1:50795</a> [AP]</div><div>HTTP/1.1 200 OK.</div><div>Server: nginx/<a href="http://0.7.67./" target="_blank">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>


</div></div>
_______________________________________________<br>varnish-misc mailing list<br><a href="mailto:varnish-misc@varnish-cache.org" target="_blank">varnish-misc@varnish-cache.org</a><br><a href="http://lists.varnish-cache.org/mailman/listinfo/varnish-misc" target="_blank">http://lists.varnish-cache.org/mailman/listinfo/varnish-misc</a></blockquote>


</div><br></div></div><br>_______________________________________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org" target="_blank">varnish-misc@varnish-cache.org</a><br>
<a href="http://lists.varnish-cache.org/mailman/listinfo/varnish-misc" target="_blank">http://lists.varnish-cache.org/mailman/listinfo/varnish-misc</a><br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>