<div dir="ltr">Hi Francis,<div><br></div><div>First of all please accept my gratitude for helping on this matter, this really worked for me and we're seeing lot of leechers blocked now.<br><br>Thanks a lot again :)<br><br>Shahzaib</div></div><div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br>
<table style="border-top:1px solid #d3d4de">
        <tr>
        <td style="width:55px;padding-top:13px"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;"></a></td>
                <td style="width:470px;padding-top:12px;color:#41424e;font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Virus-free. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link" target="_blank" style="color:#4453ea">www.avast.com</a>
                </td>
        </tr>
</table><a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 7, 2017 at 12:18 AM, Francis Daly <span dir="ltr"><<a href="mailto:francis@daoine.org" target="_blank">francis@daoine.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, Oct 06, 2017 at 07:17:39PM +0500, shahzaib mushtaq wrote:<br>
<br>
Hi there,<br>
<span class=""><br>
> We're serving mp4 files over NGINX with added security hash+ttl but there's<br>
> some kind of leechers accessing videos with following pattern but not<br>
> getting blocked:<br>
<br>
</span>You seem to suggest that you have some blocking configured, and that it<br>
does not do all that you want.<br>
<br>
What blocking do you have configured? It may be simplest to adjust that,<br>
rather than try to add something new.<br>
<br>
> <a href="https://domain.com/files/videos/2017/10/04/15071356364fc6b-720.mp4?h=n_Saa78MV6BJTcoRHwHelA&ttl=1507303734&" rel="noreferrer" target="_blank">https://domain.com/files/<wbr>videos/2017/10/04/<wbr>15071356364fc6b-720.mp4?h=n_<wbr>Saa78MV6BJTcoRHwHelA&ttl=<wbr>1507303734&</a><br>
> ?*/WhileYouWereSleeping56.mp4*<br>
<br>
> <a href="https://domain.com/files/videos/2017/10/04/15071356364fc6b-720.mp4?h=n_Saa78MV6BJTcoRHwHelA&ttl=1507303734&" rel="noreferrer" target="_blank">https://domain.com/files/<wbr>videos/2017/10/04/<wbr>15071356364fc6b-720.mp4?h=n_<wbr>Saa78MV6BJTcoRHwHelA&ttl=<wbr>1507303734&</a><br>
> ?<br>
<br>
The two question marks in the url looks odd to me; but it is in both your<br>
"bad" and "good" ones, so maybe it is normal.<br>
<span class=""><br>
> Is there a way we can block the requests not ending up on ttl value ?<br>
<br>
</span>You have $query_string, which is the same as $args. If you can define a<br>
regex pattern which matches everything you want, you can return failure<br>
for everything else.<br>
<br>
Perhaps ($args !~ "&ttl=[0-9]*&\?$") is a suitable test condition in<br>
your environment.<br>
<br>
Good luck with it,<br>
<br>
        f<br>
<span class="HOEnZb"><font color="#888888">--<br>
Francis Daly        <a href="mailto:francis@daoine.org">francis@daoine.org</a><br>
______________________________<wbr>_________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/<wbr>mailman/listinfo/nginx</a><br>
</font></span></blockquote></div><br></div>