Virtual host based on includes

Ask Bjørn Hansen ask at develooper.com
Fri Jan 14 10:04:50 CET 2011


On Jan 11, 2011, at 7:00, Jonathan Lopez wrote:

> 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.
>  
> 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).

Just generate the final configuration file with Perl, Python or whatever your favorite tool is (even m4 could do it -- like we did in the olden day!).



 - ask 





More information about the varnish-misc mailing list