Checking varnish configuration syntax

If you’ve updated your varnish server’s configuration, there doesn’t seem to be an equivalent of ‘apachectl configtest’ for it, but you can do :

varnishd -C -f /etc/varnish/default.vcl

If everything is correct, varnish will then dump out the generated configuration. Otherwise you’ll get an error message pointing you to a specific line number.

7 thoughts on “Checking varnish configuration syntax”

  1. Sometimes it’s the simple things that make life easier. Varnishlogs aren’t what you’d expect so this is a life-saver (especially after an upgrade)

  2. Yep, very helpful command, I was just pulling my hair to find where is the syntax error. Just run the command and found the remedy!

    Thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *