Artificial intelligent assistant

varnish configtest Is there a way to check varnish configuration syntax without actually using the new version? I'm searching for a native varnish equivalent of `apache2ctl configtest`

You can ask Varnish to compile your VLC file to a temporary file. This is part of our script that loads a new configuration into our varnish servers:


tmpfile=$(mktemp)
trap 'rm -f $tmpfile' 0
varnishd -C -f /srv/web/fe/varnish/default.vcl > $tmpfile
echo

if [ ! -s $tmpfile ]; then
echo "ERROR: There are errors in the varnish configuration." >&2
exit 1
fi


This works because `varnishd -C` will not generate any output on `stdout` if there are errors in the VCL.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 72b1c2c0b620e12c74c5bba4b652740c