Troubleshooting Tips for Your Custom VCL Upload


Using custom vcl gives you a lot of power over your service, but uploading it isn’t the most intuitive process. The troubleshooting tips below should help you resolve the most common uploading problems.

Upload The Entire Fastly Boilerplate

The Fastly boilerplate holds the default configurations for your service, which is why we recommend uploading it in its entirety; omitting blocks of it can cause some of Fastly’s default behavior to be overridden.

For instance, leaving the following block out of your upload could cause objects marked as “private” to stop PASSing and start caching.

if (beresp.http.Cache-Control ~ "private") {
    set req.http.Fastly-Cachetype = "PRIVATE";
    return (pass);

Tip: Ultimately, you know what’s best for your service, but if the choice is made to omit any of the boilerplate, make sure it’s done mindfully and evaluated thoroughly in a test service before deploying to production.

Make Sure You Keep the “Comments”

Under each subroutine in the boilerplate, you’ll see lines like this, which are often mistaken for comments:

#FASTLY recv

These are actually C Language style macros, which pull in the settings you’ve created in the UI. Deleting any of these from the boilerplate can prevent UI settings from working.

Tip: If you had a setting in the UI that seems to have stopped working around the time you started using custom vcl, it’s possible that at least one of the macros was inadvertently edited out of your boilerplate.

Avoid the “Pipe Not Allowed Error”

Seeing this error on upload means you’ve tried to upload your service’s generated vcl. Generated vcl is the culmination in code of all of your service’s settings, both those made in the UI and in custom vcl. It’s there to help you see the flow of your service, but isn’t meant to be uploaded as custom vcl.

Tip: If your goal is to clone a copy of your current version into a new one, you can simply click the Clone button in the top menu of your Configure screen—there’s no upload needed. Similarly, if your goal is to duplicate the settings from one service into a brand new service, go ahead and create that new service, and then contact for further assistance.