Uploading custom VCL

Fastly allows you create your own Varnish Configuration Language (VCL) files with specialized configurations. By uploading custom VCL files to the Fastly application, you can use custom VCL and Fastly VCL together at the same time. Keep in mind that custom VCL always takes precedence over VCL generated by the Fastly application.

Accessing the VCL interface

After Fastly support has enabled the ability to upload custom VCL to your account, you can access the VCL interface in the Fastly application. Follow these instructions to access the VCL interface:

  1. Log in to the Fastly application.
  2. Click the configure tab (wrench icon).

    Select the configure tab.

  3. From the Service menu, select a service and then click the blue Configure button. The main controls for your selected service appear.

  4. Click VCL from the section list on the left. The Varnish Configuration page appears.

    The Varnish Configuration controls

Uploading a VCL file

Follow these instructions to upload a custom VCL file:

  1. In the Varnish Configuration area, click the New button. The New Varnish Configuration window appears.

    The New Varnish Configuration window

  2. In the Name field, enter the name of the VCL file. For included files, this name must match the include statement in the main VCL file. See things to know when uploading multiple files for more information.

  3. Click Choose File and select a file to upload.

  4. Click Create. The VCL file appears in the Varnish Configurations area.

    ACL file as an Include example in VCL configurations

Things to know when uploading multiple files

The first VCL file you upload will be marked as Main to the right of the file name in the Varnish configurations area. Any other VCL files will be marked as Include files. They must be included in the main VCL using the syntax include "VCL Name" where VCL Name is the name of an included VCL object you've created.

For example, if you've created an included VCL object called "ACL" (to use an access control list for code manageability) and the file is named acl.vcl, your main VCL configuration file would need to contain this line:

include "ACL"

Additional resources:

Back to Top