serve healthcheck file locally

Paul Armstrong varnish-cache at
Sun Jul 20 16:35:58 CEST 2014

At 2014-07-20T10:36-0400, Tim Dunphy wrote:
>    Such that you can do a :
>    GET http://$(hostname -f):8080/healtcheck.php
>    And return the contents of that file (which is simply the word 'good').
>    I've been googling a while and not found any advice on how to server a
>    text file locally on the varnish server itself.
>    Is there any way I can do this easily in my VCL?

You can serve content directly using a synthetic response. Other than
that, you'll need to run a local webserver and redirect requests for
that file to the appropriate backend.

Having said that, if you want proper end to end testing, you're better
off either serving the healthcheck file from the backends with a
passthrough (so you can ensure that varnish is able to get to at least
one backend) or with a very short TTL (tests caching as well as backend
availability, but has a longer recovery time if a varnish host is unable
to reach any backends).


More information about the varnish-misc mailing list