Realizing vhosts with varnish

Per Buer perbu at
Thu Dec 16 17:59:30 CET 2010

On Thu, Dec 16, 2010 at 2:30 PM, Stefan Pommerening <pom at> wrote:

> of couse you only need one single vcl_recv subroutine. This applies to all
> vcl subroutines.
> I usually start with grabbing the default vcl and then add everything I
> need to the existing (default) subroutines.
> 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.

Actually, multiple definitions of the same subroutine is allowed. They are
then concatenated, the flow being terminated only by the return statements.
This is how the default VCL get overridden by your custom VCL.

There is a good example in the man vcl. Of course, this might get very
confusing when you have multiple vcl_recv subroutines spread over several
included files. Caution advised. :-)

Per Buer, Varnish Software
Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer
Varnish makes websites fly!
Want to learn more about Varnish?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the varnish-misc mailing list