<div dir="ltr"><div><div>Hello,<br><br></div> The root directory path is /var/www/html/domain and every file within it is hotlink protected for (mp4). Now here's a file named /var/www/html/domain/videos/test.mp4 and i want this file to be available for public with no hotlinking restriction. Is that possible with nginx ? vhost config is given below. Please help me regarding it.<br>
<br>server {<br> listen 80;<br> server_name <a href="http://mydomain.com">mydomain.com</a>;<br> client_max_body_size 800m;<br> limit_rate 250k;<br> access_log /websites/<a href="http://theos.in/logs/access.log">theos.in/logs/access.log</a> main;<br>
<br> location / {<br> root /var/www/html/domain;<br> index index.html index.htm index.php;<br> autoindex off;<br>}<br> <br>location ~ -720\.(mp4)$ {<br> mp4;<br>
expires 7d;<br> limit_rate 1000k;<br> root /var/www/html/domain;<br> valid_referers none blocked <a href="http://test.com">test.com</a> *.<a href="http://test.com">test.com</a> *.<a href="http://facebook.com">facebook.com</a> *.<a href="http://twitter.com">twitter.com</a>;<br>
if ($invalid_referer) {<br> return 403;<br> }<br> }<br>location ~ -480\.(mp4)$ {<br> mp4;<br> expires 7d;<br> limit_rate 250k;<br>
root /var/www/html/domain;<br> valid_referers none blocked <a href="http://test.com">test.com</a> *.<a href="http://test.com">test.com</a> *.<a href="http://facebook.com">facebook.com</a> *.<a href="http://twitter.com">twitter.com</a>;<br>
if ($invalid_referer) {<br> return 403;<br> }<br> }<br>location ~ \.(mp4)$ {<br> mp4;<br> expires 7d;<br> root /var/www/html/domain;<br>
valid_referers none blocked <a href="http://test.com">test.com</a> *.<a href="http://test.com">test.com</a> *.<a href="http://facebook.com">facebook.com</a> *.<a href="http://twitter.com">twitter.com</a>;<br>
if ($invalid_referer) {<br> return 403;<br> }<br> }<br><br><br></div>Regards.<br>Shahzaib<br><div><br><br></div></div>