Configuring a fallback server for a director

Marc Fournier marc.fournier at camptocamp.com
Wed Jun 16 10:56:12 CEST 2010


Hello,

> Is it possible to configure a fallback server (serving a static
> maintenance page) for a director with some backend
> servers in case all backend servers are down?

I had the same need some time ago, and solved it by simply switching
backends when the main ones are in an "unhealthy" state:

director cluster round-robin {
  { .backend = {
    ...
      .probe = { # required to let req.backend.healthy work
        ...
      }
    }
  }
  ...
}

backend sorryserver {
  ...
}

sub vcl_recv {

  set req.backend = cluster;

  if (!req.backend.healthy) {
    set req.backend = sorryserver;
    pass;
  }
}

I hope this helps !
Marc






More information about the varnish-misc mailing list