Welcome! Log In Create A New Profile

Advanced

Re: hotlink protection for wordpress

Max
February 04, 2010 02:58AM
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
Subject Author Posted

hotlink protection for wordpress

Max February 01, 2010 05:24AM

Re: hotlink protection for wordpress

Igor Sysoev February 01, 2010 12:54PM

Re: hotlink protection for wordpress

任晓磊 February 02, 2010 02:54AM

Re: hotlink protection for wordpress

Max February 04, 2010 02:58AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 183
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready