ubuntu VPS nginx(1.4.6)防止盗链图
location ~* \.(gif|jpg|png|bmp)$ {
valid_referers none blocked *.ttlsa.com server_names ~\.google\. ~\.baidu\.;
if ($invalid_referer) {
return 403;
#rewrite ^/ http://www.ttlsa.com/403.jpg;
}
}
上面到配置要写在location第一前面
http://www.ttlsa.com/nginx/nginx-referer/