hotlink protection with rewrite
antituhan
dewanggaba at gmail.com
Mon Jul 18 03:38:58 UTC 2011
try this :
location ~ \.(swf|mp4)$ {
valid_referers server_names *.mysite.com;
if ($invalid_referer) {
rewrite ^(.*)$ /hl.png break;
}
}
location =/hl.png {
root /home/tophi/www/images;
}
or you can try this one
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;
}
hope it useful :)
--
View this message in context: http://nginx.2469901.n2.nabble.com/hotlink-protection-with-rewrite-tp4282097p6593289.html
Sent from the nginx mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20110717/7ecd771a/attachment-0001.html>
More information about the nginx
mailing list