Virtual host based on includes

Robert Shilston rtshilston at gmail.com
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/" req.http.host “.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.

Rob

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20110112/a52e5c52/attachment-0003.html>


More information about the varnish-misc mailing list