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.
12 replies on “Checking varnish configuration syntax”
This is kind of late, but thanks.
It’s never too late to say thank you. This was exactly what I was looking for.
I was looking for logs, but this helped me right away, THANKS!
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)
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!
Thanks !
Thanks! Just what I was looking for
It’s 2017, but your solution still works like a charm! Thank you very much for posting it 🙂
Brilliant. Thank you very much. Just the command I was hoping to find. Cheers. I knew there must be some way to test varnish, but hadn’t figured out what it was.
August 2018 and still a life-saver! 🙂
thanks from 2019
Awesome, thanks! 🙂