<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Ah, well the problem seems to be one I’ve been having for a little while now. I seem to be having some trouble caching the site because of the cookie headers we’re seeing from the app.</div><div class=""><br class=""></div><div class="">However I wasn’t 100% positive that the site had to be cached in order to perform a simple redirect. But I guess that’s the case… still early in the learning curve in my defense.</div><div class=""><br class=""></div><div class="">Here’s what I saw:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px;" class=""> 11 TxURL b /</div><div style="margin: 0px;" class=""> 11 TxHeader b Host: <a href="http://www.ref.mydomain.com" class="">www.ref.mydomain.com</a></div><div style="margin: 0px;" class=""> 11 TxHeader b Accept-Encoding: gzip</div><div style="margin: 0px;" class=""> 11 TxHeader b CF-IPCountry: US</div><div style="margin: 0px;" class=""> 11 TxHeader b CF-RAY: 18eaa8c9918d0779-EWR</div><div style="margin: 0px;" class=""> 11 TxHeader b X-Forwarded-Proto: http</div><div style="margin: 0px;" class=""> 11 TxHeader b CF-Visitor: {"scheme":"http"}</div><div style="margin: 0px;" class=""> 11 TxHeader b Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8</div><div style="margin: 0px;" class=""> 11 TxHeader b User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36</div><div style="margin: 0px;" class=""> 11 TxHeader b Accept-Language: en-US,en;q=0.8</div><div style="margin: 0px;" class=""> 11 TxHeader b Cookie: fbm_442804139174102=base_domain=.<a href="http://ref.mydomain.com" class="">ref.mydomain.com</a>; __cfduid=dfa49971056a2f2a4a2f881ef2e663a431416008779; PHPSESSID=mcltfa0qa3j2ih74cghnbjmbr6; cc_loggedin=0; fbsr_442804139174102=wXv6DlnzVYdng14lQgVjpgYou13ihkNUs52kSy0XJM0.eyJhbGdvcml0aG0iOiJITUFD</div><div style="margin: 0px;" class=""> 11 TxHeader b CF-Connecting-IP: 10.10.10.5</div><div style="margin: 0px;" class=""> 11 TxHeader b True-Client-IP: 0</div><div style="margin: 0px;" class=""> 11 TxHeader b X-Forwarded-For: 10.10.10.5, 10.10.10.6</div><div style="margin: 0px;" class=""> 11 TxHeader b X-Varnish: 286678851</div><div style="margin: 0px;" class=""> 14 TxHeader c Server: Apache/2.2.15 (CentOS)</div><div style="margin: 0px;" class=""> 14 TxHeader c X-Powered-By: PHP/5.6.3</div><div style="margin: 0px;" class=""> 14 TxHeader c Expires: Thu, 19 Nov 1981 08:52:00 GMT</div><div style="margin: 0px;" class=""> 14 TxHeader c Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0</div><div style="margin: 0px;" class=""> 14 TxHeader c Content-Type: text/html; charset=UTF-8</div><div style="margin: 0px;" class=""> 14 TxHeader c Content-Length: 11391</div><div style="margin: 0px;" class=""> 14 TxHeader c Accept-Ranges: bytes</div><div style="margin: 0px;" class=""> 14 TxHeader c Date: Tue, 25 Nov 2014 03:11:29 GMT</div><div style="margin: 0px;" class=""> 14 TxHeader c X-Varnish: 286678851</div><div style="margin: 0px;" class=""> 14 TxHeader c Age: 0</div><div style="margin: 0px;" class=""> 14 TxHeader c Via: 1.1 varnish</div><div style="margin: 0px;" class=""> 14 TxHeader c Connection: close</div><div style="margin: 0px;" class=""> <b class="">14 TxHeader c X-Cache: MISS</b></div><div style="margin: 0px;" class=""> 11 TxURL b /cometchat/cometchat_receive.php</div><div style="margin: 0px;" class=""> 11 TxHeader b Host: <a href="http://www.ref.mydomain.com" class="">www.ref.mydomain.com</a></div><div style="margin: 0px;" class=""> 11 TxHeader b Accept-Encoding: gzip</div><div style="margin: 0px;" class=""> 11 TxHeader b CF-IPCountry: US</div><div style="margin: 0px;" class=""> 11 TxHeader b CF-RAY: 18eaa8cf561c0779-EWR</div><div style="margin: 0px;" class=""> 11 TxHeader b Content-Length: 92</div><div style="margin: 0px;" class=""> 11 TxHeader b X-Forwarded-Proto: http</div><div style="margin: 0px;" class=""> 11 TxHeader b CF-Visitor: {"scheme":"http"}</div><div style="margin: 0px;" class=""> 11 TxHeader b Accept: */*</div><div style="margin: 0px;" class=""> 11 TxHeader b Origin: <a href="http://www.ref.mydomain.com" class="">http://www.ref.mydomain.com</a></div><div style="margin: 0px;" class=""> 11 TxHeader b X-Requested-With: XMLHttpRequest</div><div style="margin: 0px;" class=""> 11 TxHeader b User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36</div><div style="margin: 0px;" class=""> 11 TxHeader b Content-Type: application/x-www-form-urlencoded</div><div style="margin: 0px;" class=""> 11 TxHeader b Referer: <a href="http://www.ref.mydomain.com/" class="">http://www.ref.mydomain.com/</a></div><div style="margin: 0px;" class=""> 11 TxHeader b Accept-Language: en-US,en;q=0.8</div><div style="margin: 0px;" class=""> 11 TxHeader b Cookie: fbm_442804139174102=base_domain=.<a href="http://ref.mydomain.com" class="">ref.mydomain.com</a>; __cfduid=dfa49971056a2f2a4a2f881ef2e663a431416008779; PHPSESSID=mcltfa0qa3j2ih74cghnbjmbr6; cc_loggedin=0; fbsr_442804139174102=wXv6DlnzVYdng14lQgVjpgYou13ihkNUs52kSy0XJM0.eyJhbGdvcml0aG0iOiJITUFD</div><div style="margin: 0px;" class=""> 11 TxHeader b CF-Connecting-IP: 10.10.10.5</div><div style="margin: 0px;" class=""> 11 TxHeader b True-Client-IP: 0</div><div style="margin: 0px;" class=""> 11 TxHeader b X-Forwarded-For: 10.10.10.5, 10.10.10.6</div><div style="margin: 0px;" class=""> 11 TxHeader b X-Varnish: 286678852</div><div style="margin: 0px;" class=""> 14 TxHeader c Server: Apache/2.2.15 (CentOS)</div><div style="margin: 0px;" class=""> 14 TxHeader c X-Powered-By: PHP/5.6.3</div><div style="margin: 0px;" class=""> 14 TxHeader c Expires: Thu, 19 Nov 1981 08:52:00 GMT</div><div style="margin: 0px;" class=""> 14 TxHeader c Cache-Control: max-age=29030400</div><div style="margin: 0px;" class=""> 14 TxHeader c Content-Type: application/json; charset=utf-8</div><div style="margin: 0px;" class=""> 14 TxHeader c Content-Length: 17</div><div style="margin: 0px;" class=""> 14 TxHeader c Accept-Ranges: bytes</div><div style="margin: 0px;" class=""> 14 TxHeader c Date: Tue, 25 Nov 2014 03:11:30 GMT</div><div style="margin: 0px;" class=""> 14 TxHeader c X-Varnish: 286678852</div><div style="margin: 0px;" class=""> 14 TxHeader c Age: 0</div><div style="margin: 0px;" class=""> 14 TxHeader c Via: 1.1 varnish</div><div style="margin: 0px;" class=""> 14 TxHeader c Connection: close</div><div style="margin: 0px;" class=""> <b class="">14 TxHeader c X-Cache: MISS</b></div></div><div style="margin: 0px;" class=""><b class=""><br class=""></b></div><div style="margin: 0px;" class="">Is there anything varnish can do to cope with these cookie headers?</div><div style="margin: 0px;" class=""><br class=""></div><div style="margin: 0px;" class="">Thanks</div><div style="margin: 0px;" class="">Tim</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 24, 2014, at 9:15 PM, Norberto Meijome <<a href="mailto:numard@gmail.com" class="">numard@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><p dir="ltr" class="">Doh...sorry didn't mean to email privately... Dumb phone.</p>
<div class="gmail_quote">On 24/11/2014 11:03 pm, "Norberto Meijome" <<a href="mailto:numard@gmail.com" class="">numard@gmail.com</a>> wrote:<br type="attribution" class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr" class="">Hey Tim,<br class="">
It seems you are replacing the http header of the request - your backend would see <a href="http://WWW.ref.mydomain" class="">WWW.ref.mydomain</a> . is this what you intend, or do you mean 'redirect the browser to <a href="http://www.ref.mydomain" class="">www.ref.mydomain</a>...' ?<br class="">
In what sub did you add this?</p>
<div class="gmail_quote">On 24/11/2014 10:52 pm, "Tim Dunphy" <<a href="mailto:bluethundr@gmail.com" target="_blank" class="">bluethundr@gmail.com</a>> wrote:<br type="attribution" class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Hello,<div class=""><br class=""></div><div class=""> I'm trying to forward the top level domain for my site '<a href="http://ref.mydomain.com/" target="_blank" class="">ref.mydomain.com</a>' to the www version '<a href="http://www.ref.mydomain.com/" target="_blank" class="">www.ref.mydomain.com</a>'. </div><div class=""> </div><div class=""> This is the logic I tried in my vcl_recv </div><div class=""><br class=""></div><div class=""> if (req.http.host ~ "^ref\.mydomain\.com$") {
<p class=""> set req.http.host = "<a href="http://www.ref.mydomain.com/" target="_blank" class="">www.ref.mydomain.com</a>";</p><p class=""> }</p><div class="">And after cycling the varnish service, there's no joy! Putting <a href="http://ref.mydomain.com/" target="_blank" class="">ref.mydomain.com</a> doesn't forward to the other URL.</div><div class=""><br class=""></div><div class="">So maybe there's some problem with that statement that I'm missing?</div><div class=""><br class=""></div><div class="">I'd definitely appreciate any thoughts you might have.</div><div class=""><br class=""></div><div class="">Thanks!</div><div class="">Tim</div><div class=""><br class=""></div>-- <br class=""><div class="">GPG me!!<br class=""><br class="">gpg --keyserver <a href="http://pool.sks-keyservers.net/" target="_blank" class="">pool.sks-keyservers.net</a> --recv-keys F186197B<br class=""><br class=""></div>
</div></div>
<br class="">_______________________________________________<br class="">
varnish-misc mailing list<br class="">
<a href="mailto:varnish-misc@varnish-cache.org" target="_blank" class="">varnish-misc@varnish-cache.org</a><br class="">
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" target="_blank" class="">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><br class=""></blockquote></div>
</blockquote></div>
</div></blockquote></div><br class=""></body></html>