Nginx的防盗链

简单的通过referer判断

location ~ .*\.(gif|jpg|jpeg|png|bmp|wma|mp3|swf)$ {
       valid_referers none blocked server_names *.163.com 163.com baidu.com;  
      if ($invalid_referer) {return 403;}
      expires      30d;
 }

你可能感兴趣的:(nginx)