On 08/02/2012 01:55 PM, Oddur Snær Magnússon wrote:
Seems like the fallback director is what I want, if I can get it to
try to continue trying on 404.
I could possibly map 404 to 503(temp unavailable)
https://www.varnish-cache.org/docs/trunk/reference/vcl.html#the-fallback-director
the fallback director means that your secondairy backends don't get any
requests, unless the first backend is unhealthy. I'm not sure if that's
what you want.
I'm using the following setup to allow retries on different backends:
director cluster1 random {
{ .backend = backend1; .weight = 10; }
{ .backend = backend2; .weight = 10; }
...
}
sub vcl_recv {
...
set req.backend = cluster1;
...
}
sub vcl_fetch {
if (! beresp.cacheable) {
if (beresp.status == 404 || beresp.status == 500 ||
beresp.status == 503) {
if (req.restarts < 3) {
return (restart);
}
}
return (pass);
}
return (deliver);
}
Enno
_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc