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

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:

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

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?

Submit an answer

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

I have the same problems

<blockquote>vcl_fetch is now vcl_backend_response <cite title=“Source:”><a href=“”></a></cite></blockquote> <br>Try replacing <code>vcl_fetch</code> with <code>vcl_backend_response</code>.