Source Wikipedia :
Also you will notice that i didn’t put “none” in valid_referers, this is because you can fake null referrer and anyone could access your protected files and leech it again without your approval.
You can add those directive in folder too so you will not need to specify extension/s eg. location /videos/ { .. } and this will protect any file inside this directory.
Notice :
You should consider to remove “none” from valid_referers because some browsers like IE can not understand this redirect.
Hotlinking is a term used on the Internet that refers to the practice of displaying an image on a website by linking to the same image on another website, rather than saving a copy of it on the website on which the image will be shown.Hotlinking can be major issue for bandwidth leeching for some sites. Here is small config part which you can add to prevent those activities.
server {
location ~ \.(mp4|mp3|wav|avi)$ {
valid_referers blocked example.com *.example.com;
if ($invalid_referer) {
return 403;
}
}
}
To specify more file types you need to use pipe “|”.Also you will notice that i didn’t put “none” in valid_referers, this is because you can fake null referrer and anyone could access your protected files and leech it again without your approval.
You can add those directive in folder too so you will not need to specify extension/s eg. location /videos/ { .. } and this will protect any file inside this directory.
Notice :
You should consider to remove “none” from valid_referers because some browsers like IE can not understand this redirect.
No comments:
Post a Comment