try this :
<pre>location ~ \.(swf|mp4)$ {
valid_referers server_names *.mysite.com;
if ($invalid_referer) {
rewrite ^(.*)$ /hl.png break;
}
}
location =/hl.png {
root /home/tophi/www/images;
}</pre>
or you can try this one
<pre>
location ~ \.(swf|mp4)$ {
valid_referers server_names none *.mysite.com;
if ($invalid_referer) {
rewrite ^(.*)$ /hl.png break;
}
}
location =/hl.png {
root /home/tophi/www/images;
}</pre>
hope it useful :)
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://nginx.2469901.n2.nabble.com/hotlink-protection-with-rewrite-tp4282097p6593289.html">Re: hotlink protection with rewrite</a><br/>
Sent from the <a href="http://nginx.2469901.n2.nabble.com/">nginx mailing list archive</a> at Nabble.com.<br/>