Nginx防盗链配置

   location ~* ^.+.(jpg|gif|png|swf|flv|wma|wmv|asf|mp3|mmf|zip|rar)$ {

        valid_referers none blocked *.template.com template.com;
        if ($invalid_referer) {

        rewrite ^/ http://www.template.com/nolik.gif;

}
原文地址:https://www.cnblogs.com/Template/p/9257491.html