Report this

What is the reason for this report?

Varnish 4.0 Error: VCL sub's named 'vcl*' are reserved names.

Posted on April 29, 2014

Today i installed varnish 4.0 on my ubuntu 14.04 (LEMP) droplet for Wordpress hosting.

I try to config Vartish 4.0 with this tutorial: https://www.digitalocean.com/community/articles/how-to-install-wordpress-nginx-php-and-varnish-on-ubuntu-12-04

but, when i try to restart varnish, i see this error:

  • Starting HTTP accelerator varnishd [fail] Message from VCC-compiler: VCL sub’s named ‘vcl*’ are reserved names. (‘input’ Line 29 Pos 5) sub vcl_fetch { ----#########–

Valid vcl_* methods are: vcl_recv vcl_pipe vcl_pass vcl_hash vcl_purge vcl_miss vcl_hit vcl_deliver vcl_synth vcl_backend_fetch vcl_backend_response vcl_backend_error vcl_init vcl_fini Running VCC-compiler failed, exit 1

VCL compilation failed

In varnish 4.0 is vcl_* reserved “Any custom-made subs cannot be named ‘vcl_*’ anymore. This namespace is reserved for builtin subs.” https://www.varnish-cache.org/docs/trunk/whats-new/upgrading.html

How i need to change this code:

Drop any cookies Wordpress tries to send back to the client.

sub vcl_fetch { if (!(req.url ~ “wp-(login|admin)”)) { unset beresp.http.set-cookie; } }

, for solve this error?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.