Virtual host based on includes

Robert Shilston rtshilston at
Wed Jan 12 16:12:26 CET 2011

On 12 Jan 2011, at 15:08, Jonathan Lopez wrote:

>         set req.http.Host = regsub(req.http.Host, "^www\.", "");        
>         include "/etc/varnish/" “.vcl”;
> 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).

I don't think this will work, because of the way that the VCL files are compiled when they are loaded.  If you do have hundreds of hosts, I think you'd be better off writing a small Perl script to create your master VCL based on doing a directory listing of the individual VCL files, and using a big if/else structure.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the varnish-misc mailing list