vHosts (name or ip based) with varnish

Jonathan Lopez jonathanlopez at blackslot.com
Wed Jan 12 13:18:16 CET 2011

Hi Frank,

Yesterday i tried to send a mail to the list to ask for a similar topic, but i dont know why is waiting the approval by the moderator.

In this mail I ask for a way to do this virtual host with something like this:

sub vcl_recv {

        set req.http.Host = regsub(req.http.Host, "^www\.", ""); 
        include "/etc/varnish/" req.http.host ".vcl";


Then, each domain has a customized VCL in his own file. I think this method is better than a lot of if/else.

Is this possible? I have tried everything but with no success. I don't want to make a huge if/else condition for each domain (virtual host).


-----Mensaje original-----
De: varnish-misc-bounces at varnish-cache.org [mailto:varnish-misc-bounces at varnish-cache.org] En nombre de Frank Helmschrott
Enviado el: miércoles, 12 de enero de 2011 9:59
Para: varnish-misc at varnish-cache.org
Asunto: vHosts (name or ip based) with varnish


via google i came to this post on varnish-software.com regarding vhost solutions for varnish:

I'd like to have a similar solution with an 'as small as possible'
master.vcl that does the if/elsif part. I'd like to have mostly different configurations for each host.

Does anyone know where to place this if/elsif part? Varnish expects at least acl, sub, backend or director in the vcl and i'm quite unsure how to keep this vcl as simple/small as possible and load most of the staff through the other vcls.



varnish-misc mailing list
varnish-misc at varnish-cache.org

More information about the varnish-misc mailing list