Hotlink prevention doesn't work for me?

Hi all!

I got the following in my config:


location / {

valid_referers none blocked site.domain.com ~(google.);
if ($invalid_referer) {
rewrite ^/wp-content/uploads.*.(gif|jpg|jpeg|png)$
http://site2.domain.com/dont_hotlink.png last;
}

[…]


Why isn’t this sending all ‘foreign’ .jpg file requests to
http://site2.domain.com/dont_hotlink.png ?

Using nginx 1.0.5

greetings,
Evert

Posted at Nginx Forum:

I don’t mean to hijack your discussion but it’s relevant - how do I
allow Facebook as a referrer