I put this in the conf file and it works well now. I put it just under the
"access log line", I am not sure if I put it at the end of the conf, it
might not work.
location ~ \.(jpg|jpeg|png|gif)$ {
root /home/user/docs;
valid_referers none block server_names ~(domain1.com|google.);
if ($invalid_referer) {
rewrite ^(.*)$ /wp-content/uploads/av.gif break;
}
}
You might also want to check this blog:
http://linuxsysadminblog.com/2009/08/using-wildcards-in-nginx-valid_referers/
On Tue, Feb 2, 2010 at 3:50 PM, 任晓磊 <julyclyde@gmail.com> wrote:
> Yep, yesterday, I got the same mistake.
>
> It works after I put location *.gif section into location / section.
>
> One who ask this question should check your error.log for information.
>
> 2010/2/2 Igor Sysoev <igor@sysoev.ru>:
> > Have you look in error log ? Probably, you should add "root" in
>
> --
> Ren Xiaolei
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx