hotlink protection with rewrite

tophi nginx-forum at nginx.us
Sat Jul 16 11:39:38 UTC 2011


None of the above methos has helped me.
My files are .swf and .mp4 .
Here is an example of my conf 


valid_referers none blocked mysite.com;
location /home/tophi/www/files/
{
if ($invalid_referer) {
rewrite ^ /home/tophi/www/images/hl.png last;
}
}


location ~ \.(swf|mp4)$ {
valid_referers server_names blocked *.mysite.com;
if ($invalid_referer) {
rewrite ^(.*)$ /home/tophi/www/images/hl.png break;
}
}

please advice 
thanks

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,39501,212475#msg-212475




More information about the nginx mailing list