unexpected pass messages in log files

Andrew Smallbone andrew at rocketnumbernine.com
Mon Jul 1 10:57:53 CEST 2013


Should have looked harder myself - front end is adding an unused Cookie.
Adding "unset req.http.cookie;" to vcl_recv results in caching

regards
Andrew


On 1 July 2013 11:15, Andrew Smallbone <andrew at rocketnumbernine.com> wrote:
> I'm using varnish in a simple system, everything works fine when I
> test using curl and web browsers and load testing systems, but when
> the content is accessed by our iOS/unity front end, I'm getting "pass"
> messages in the log files.  Presumably the HTTP request is subtly
> different (It's being logged as HTTP1.1, all requests both working and
> not are coming through Amazon ELB - which is terminating the SSL).
>
> Any hints if there's anything I can do with Varnish to see what the
> issue is or am I missing something really basic?
>
> varnished (varnish-3.0.3 revision 9e6a70f)
> My default.vcl is below - only weirdness is if a specific header isn't
> present the request is forwarded to another website, and that header
> value is also used in the hash key
>
> sub vcl_recv {
>   if (req.http.x-forwarded-for) {
>     set req.http.X-Forwarded-For =
>     req.http.X-Forwarded-For + ", " + client.ip;
>   } else {
>     set req.http.X-Forwarded-For = client.ip;
>   }
>   # ignore AWS/ELB health messages
>   if (req.url ~ ".*/health/.*") {
>     return (pass);
>   }
>   // if no header error
>   if (!req.http.xxx) {
>     error 750 "Moved";
>   }
> }
> sub vcl_error {
>   if (obj.status == 750) {
>     set obj.response = "Moved Temporarily";
>     set obj.http.Location = "http://www.badrequest.com/";
>   }
>   set obj.status = 302;
>   return (deliver);
> }
> # store results for each header code
> sub vcl_hash {
>     hash_data(req.url);
>     hash_data(req.http.xxx);
>     return (hash);
> }
> sub vcl_fetch {
>     set beresp.ttl = 60s;
> }
> # remove http headers to confuse bad people
> sub vcl_deliver {
>    remove resp.http.X-Varnish;
>    remove resp.http.Via;
>    set resp.http.Server = "xxx";
> }
>
>
> regards



More information about the varnish-misc mailing list