#SECURITY-START 防盗链配置
location ~ .*\.(jpg|jpeg|gif|png)$
{
expires 30d;
access_log /dev/null;
valid_referers *.xxxx.com xxxx.com;
if ($invalid_referer){
#rewrite ^/ http://ww4.sinaimg.cn/bmiddle/051bbed1gw1egjc4xl7srj20cm08aaa6.jpg;
return 404;
}
}
#SECURITY-END
以上替换网站-配置文件
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
error_log off;
access_log /dev/null;
}
网友评论