Uploading custom VCL

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

Uploading a VCL file

After Fastly support has enabled the ability to upload custom VCL to your account, follow these instructions to upload a custom VCL file:

  1. Log in to the Fastly web interface and click the Configure link.
  2. From the service menu, select the appropriate service.
  3. Click the Edit configuration button and then select Clone active. The service version page appears.
  4. Click the Custom VCL tab. The Varnish Configurations page appears.
  5. Click the Upload a new VCL file button. The Upload a new VCL file page appears.

    the default upload a new VCL file page

  6. 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.

  7. Click Upload file and select a file to upload. The name of the uploaded file appears next to the button.

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

    an example main vcl file in the varnish configurations area that's been designated as the main vcl

Including additional VCL configurations

You can apply additional VCL files along with your main VCL by including their file names in the main VCL file 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