./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.
解决方法:
第一种:
yum install pcre* --安装系统自带的pcre库文件就可以了
sub vcl_recv {
if (req.method == "PURGE") {
if (!client.ip ~ purgers) {
return(synth(405,"Method not allowed"));
}
return(hash);
}
if (req.http.host ~ "web.cluster.com") {
set req.backend_hint = lnmp ;
} else {
return(synth(404,"error domain name"));
}
}
sub vcl_miss {
return(fetch);
}
sub vcl_hit {
if (req.method == "PURGE") {
unset req.http.cookie;
return(synth(200,"Purged"));
}
}
sub vcl_backend_response {
if (bereq.url ~ "\.(jpg|jpeg|gif|png)$") {
set beresp.ttl = 1d;
}
if (bereq.url ~ "\.(html|css|js)$") {
set beresp.ttl = 6h;
}
if (beresp.http.Set-Cookie) {
return(deliver);
}
}
sub vcl_deliver {
if (obj.hits > 0) {
set resp.http.X-Cache = "@_@ HIT from " + server.ip;
} else {
set resp.http.X-Cache = "@_@ oh,god,MISS";
}
}