[ASK] Restrict direct link file access

Edho P Arief edhoprima at gmail.com
Sat Aug 14 03:00:52 MSD 2010


On Fri, Aug 13, 2010 at 3:44 AM, antituhan <dewanggaba at gmail.com> wrote:
> Hi, Could nginx restrict direct link access / hotlink access to specified
> file/extension ?
> I try to write the rules like this :
>
>  location ~ ^/*(\.exe)$ {
>         deny   ip.ad.dr.es;
>     }
>
> But nothing happen, the files still can be downloaded by denied ip address.
> Somebody help me please :)

at least, you forgot a dot.

  location ~ ^/.*(\.exe)$ {
         deny   ip.ad.dr.es;
     }

(note that I'm not too familiar with deny directive)

-- 
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org



More information about the nginx mailing list