nginx防盗链
location ~* \.(gif|jpg|png|swf|flv)$ {
root html
valid_referers none blocked *.nginxcn.com;
if ($invalid_referer) {
rewrite ^/ [www.nginx.cn](http://www.nginx.cn/)
#return 404;
}
}
前面的root可以不要如果你在server{}中有设置可以不需要设定
原文: https://wizardforcel.gitbooks.io/nginx-doc/content/Text/7.5_doorchain.html