varnish防盜鏈設置

 
# 防盜鏈
if (req.http.referer ~ "http://.*") {
    if ( ! (req.http.referer ~ " http://.*aaa\.com"
          || req.http.referer ~  http://.*bbb\.com
          || req.http.referer ~  http://.*ccc\.com"
       )) {
       error 404 "Not found!";
       set req.http.host = " www.xxx.com";
       set req.url = "/daolian.jpg";
 }
}
 

你可能感兴趣的:(varnish防盜鏈設置)