Serving static html when all backends are sick

Guillaume Quintard guillaume at varnish-software.com
Mon Dec 12 19:51:55 CET 2016


A director is considered healthy is any of its backend is healthy, so if
you put a director in req.backend_hint, you're good.

-- 
Guillaume Quintard

On Wed, Dec 7, 2016 at 9:29 AM, Thijs Cramer <t.cramer at beslist.nl> wrote:

> Given the following code:
>
> =========================================
> sub vcl_synth {
>   if (resp.status == 999) {
>     set resp.status = 200;
>     set resp.http.Content-Type = "text/html; charset=utf-8";
>     synthetic( {"Static HTML"} );
>     return(deliver);
>   }
> }
>
> # Check if backend is healthy, otherwise, redirect
> if (!std.healthy(req.backend_hint)) {
>   return (synth(999, "All backends down."));
> }
>
> =========================================
>
> Will the static page be served if ALL backends are down, or just when
> the specific backend it got back from the backend_hint is down?
>
> We want to be able to serve static html as a fallback if all backends
> are down.
>
> Is this the proper way to do this?
>
> Thanks in advance!
>
> - Thijs
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20161212/5b3e3db3/attachment.html>


More information about the varnish-misc mailing list