清漆多个VCL WordPress和Mgento

我想configuration我的清服务器根据主机名具有不同的.vclconfiguration。 我有wordpress和magento在同一个服务器apache +清漆4.1.2

这是我试图创build的default.vcl,但是我需要为wordpress包含一个特定的vcl?

vcl 4.0; # Default backend definition. Set this to point to your content server. backend default { .host = "127.0.0.1"; .port = "8888"; } sub vcl_recv { # Happens before we check if we have this in cache already. # # Typically you clean up the request here, removing cookies you don't need, # rewriting the request, etc. if (! req.http.Host) { error 404 "Need a host header"; } set req.http.Host = regsub(req.http.Host, "^www\.", ""); set req.http.Host = regsub(req.http.Host, ":80$", ""); if (req.http.Host == "hostname1.com") { include "/etc/varnish/wordpress.vcl"; } elsif (req.http.Host == "hostname2.com") {include "/etc/varnish/magento.vcl";} } sub vcl_backend_response { } sub vcl_deliver { }