I put this in the conf file and it works well now. I put it just under the &quot;access log line&quot;, I am not sure if I put it at the end of the conf, it might not work.<br><br>location ~ \.(jpg|jpeg|png|gif)$ {<br>root /home/user/docs;<br>
valid_referers none block server_names ~(<a href="http://domain1.com">domain1.com</a>|google.);<br>if ($invalid_referer) {<br>rewrite  ^(.*)$ /wp-content/uploads/av.gif break;<br>               }<br>       }<br><br>You might also want to check this blog: <a href="http://linuxsysadminblog.com/2009/08/using-wildcards-in-nginx-valid_referers/">http://linuxsysadminblog.com/2009/08/using-wildcards-in-nginx-valid_referers/</a><br>
<br><div class="gmail_quote">On Tue, Feb 2, 2010 at 3:50 PM, 任晓磊 <span dir="ltr">&lt;<a href="mailto:julyclyde@gmail.com">julyclyde@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Yep, yesterday, I got the same mistake.<br>
<br>
It works after I put location *.gif section into location / section.<br>
<br>
One who ask this question should check your error.log for information.<br>
<br>
2010/2/2 Igor Sysoev &lt;<a href="mailto:igor@sysoev.ru">igor@sysoev.ru</a>&gt;:<br>
<div class="im">&gt; Have you look in error log ? Probably, you should add &quot;root&quot; in<br>
<br>
</div><font color="#888888">--<br>
Ren Xiaolei<br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
</div></div></blockquote></div><br>