make varnish still respond if backend dead

Sascha Ottolski ottolski at web.de
Thu Apr 24 10:28:09 CEST 2008


Am Mittwoch 23 April 2008 19:34:14 schrieb Max Clark:
> Did you find a solution to this?

not really, I hope to have found a workaround by adding this to my vcl:

sub vcl_fetch {
    remove obj.http.X-Varnish-Host;
    set    obj.http.X-Varnish-Host = "myhostname";

    if (obj.status == 404) {
        set obj.ttl = 7200s;
    }
}

so 404 still may happen, but are cached shorter than my default.


Cheers, Sascha


>
> On Fri, Apr 4, 2008 at 12:51 AM, Sascha Ottolski <ottolski at web.de> 
wrote:
> > Hi,
> >
> >  sorry if this is FAQ: what can I do to make varnish respond to
> > request if it's backend is dead. should return cache hits, of
> > course, and a "proxy error" or something for a miss.
> >
> >  and how can I prevent varnish to cache "404" for objects it
> > couldn't fetch due to a dead backend? at least I think that is what
> > happened, as varnish reported 404 for URLs that definetely exist;
> > the dead backend seems to be the only logical explanation why
> > varnish could think it's not.
> >
> >  oh, and is there a way to put the local hostname in a header? I
> > have two proxies, load balanced by LVS, so using server.ip reports
> > the same IP on both nodes.
> >
> >
> >  Thanks, Sascha
> >  _______________________________________________
> >  varnish-misc mailing list
> >  varnish-misc at projects.linpro.no
> >  http://projects.linpro.no/mailman/listinfo/varnish-misc





More information about the varnish-misc mailing list