Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Re: Block file access in specific directory

$
0
0
Sitruc Wrote:
-------------------------------------------------------
> I need to block access to log files that are stored in a publicly
> accessible directory from being viewed publicly. These are stored as
> CGI files and as things are right now, anyone can view the directory
> directly and download the .CGI file which is a huge security concern
> as it showcases IP address of visitors and other things.
>
>
> How can I block access to "/path/to/the/directory/*.cgi" ?
>
> I tried:
>
> location /path/to/the/directory/*.cgi {
> deny all;
> }
>
> But it did not work.

What about:

location ~ /path/to/the/directory/*\.cgi$ {
deny all;
}

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>