Migrating Varnish 3 vcl to Varnish 4

I’ve been running Varnish 3 for a while now on my own server and I have created a general configuration for my setup. I also use this configuration as some sort of template if I have to configure Varnish for a client.

Recently I had to setup and configure Varnish 4 for a new project. I was eager to test if my previously created configuration for Varnish 3 would work with the new version.

Fortunately there is a way to verify if your configuration will compile:

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

You don’t have to define every vcl that you’re using if these are included in the default.vcl. This check will automatically go over every include.

If all goes well you will get the compiled output. If not you will receive an error message with the location where this error can be found.

If you are, just like I was, migrating from Varnish 3 to 4 then the “Upgrading to Varnish 4” page will provide a lot of helpful information to solve the errors.

Tagged on: , ,

Leave a Reply

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