Re: Maintenance message
On Feb 10, 2010, at 3:04 AM, Reinis Rozitis wrote: >> I have a varnish server working well, but I'd like to have a standby server >> that does nothing but server up "Sorry we are >> preforming maintenance". My thought was to write VCL code to check the >> health of the director, and if that was bad use a different >> server (something like the example below). But that doesn't work. Any >> suggestions? > > Why not use the vcl_error ? > Just customize the default html which is included in the sample config and > you can have a nice error page without even the need of a > extra server. > Thanks for the suggestion, but our error page isn't trivial and I don't like the idea of maintaining the site within a varnish configuration file. It actually won't be an extra server, it will just be on a port on the same machine as varnish. But served by a proper http server. -Brad ___ varnish-misc mailing list varnish-misc@projects.linpro.no http://projects.linpro.no/mailman/listinfo/varnish-misc
Re: Maintenance message
Why not use the vcl_error ? Just customize the default html which is included in the sample config and you can have a nice error page without even the need of a extra server. Or you mean the whole director config doesnt work? rr - Original Message - From: "Brad Schick" To: Sent: Wednesday, February 10, 2010 8:54 AM Subject: Maintenance message >I have a varnish server working well, but I'd like to have a standby server >that does nothing but server up "Sorry we are >preforming maintenance". My thought was to write VCL code to check the health >of the director, and if that was bad use a different >server (something like the example below). But that doesn't work. Any >suggestions? > > backend web1 { >.host = "10.0.0.1"; >.probe = { >.url = "/"; >.window = 5; >.threshold = 3; >} > } > > backend web2 { >.host = "10.0.0.2"; >.probe = { >.url = "/"; >.window = 5; >.threshold = 3; >} > } > > backend maint { >.host = "127.0.0.1"; > } > > director cluster round-robin { >{ .backend = web1; } >{ .backend = web2; } > } > > sub vcl_recv { >if(cluster.healthy){ >set req.backend = cluster; >} >else { >set req.backend = maint; >} >... > } > > sub vcl_fetch { >if(req.backend == maint) { >pass; >} > ... > } > ___ > varnish-misc mailing list > varnish-misc@projects.linpro.no > http://projects.linpro.no/mailman/listinfo/varnish-misc > ___ varnish-misc mailing list varnish-misc@projects.linpro.no http://projects.linpro.no/mailman/listinfo/varnish-misc
Re: Maintenance message
In message <2caa2d26-7b56-4402-88e1-559361135...@gmail.com>, Brad Schick writes : >I have a varnish server working well, but I'd like to have a standby >server that does nothing but server up "Sorry we are preforming >maintenance". My thought was to write VCL code to check the health >of the director, and if that was bad use a different server (something >like the example below). But that doesn't work. Any suggestions? Actually, it just takes a bit of a detour: sub vcl_recv { set req.backend = cluster; if (!req.backend.healthy) { set req.backend = maint; } } -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 p...@freebsd.org | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. ___ varnish-misc mailing list varnish-misc@projects.linpro.no http://projects.linpro.no/mailman/listinfo/varnish-misc