Realizing vhosts with varnish

Kristian Lyngstol kristian at
Fri Dec 17 08:49:31 CET 2010

On Thu, Dec 16, 2010 at 02:30:17PM +0100, Stefan Pommerening wrote:
> If you use the include statement you have to keep in mind that
> inclusion is a textual substitution - therefore no repeated definition of
> vcl_recv (or even other subroutines) is allowed.

This is incorrect.

You can define all routines as many times as you want. They are executed in
the order they are included and - most importantly - they STOP executing at
the first return().

The very last VCL "included" is the default VCL - that is why you do not
need to copy the logic on the default VCL unless you are planning on
return()ing in your custom VCL: unless you issue return(), VCL execution
continues until all (including the default) variants of a subroutine is

If you define include inside of vcl_recv, then you can not have any sub's
in the included file. The reason is simple: you can't define vcl_recv
inside vcl_recv.

- Kristian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <>

More information about the varnish-misc mailing list