我已经安装了Apache和Tomcat,并希望在它们面前安装Varnish,静态转到Apache,动态转到Tomcat(所有/ static / * url转到Apache,应该由Varnish缓存,其他网址转到Tomcat)的
如何配置清漆?
backend static {
.host = "127.0.0.1";
.port = "8080";
}
backend dynamic {
.host = "127.0.0.1";
.port = "8081";
}
sub vcl_recv {
if (req.url ~ "^/static/") { # How to determine which backend to go to, and cache it?
return (lookup); # return (static.lookup)?
} else {
return (lookup);
}
return (lookup);
}