Question

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

  • Posted 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?

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I have the same problems

<blockquote>vcl_fetch is now vcl_backend_response <cite title=“Source:”><a href=“https://www.varnish-cache.org/docs/trunk/whats-new/upgrading.html”>https://www.varnish-cache.org/docs/trunk/whats-new/upgrading.html</a></cite></blockquote> <br>Try replacing <code>vcl_fetch</code> with <code>vcl_backend_response</code>.