hotlink protection with rewrite

tophi nginx-forum at
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;
location /home/tophi/www/files/
if ($invalid_referer) {
rewrite ^ /home/tophi/www/images/hl.png last;

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

please advice 

Posted at Nginx Forum:,39501,212475#msg-212475

More information about the nginx mailing list