nginx prevent file download

Kaushal Shriyan kaushalshriyan at gmail.com
Wed Aug 29 15:45:26 UTC 2018


Hi,

I am running nginx webserver and i have set the below location block in
nginx.conf configuration file to prevent a file to download.  When i hit
http://example.com/web.config on the browser, the web.config file gets
downloaded. It is not working.

location ~* \.(config)$ {
    deny all;
}


I will appreciate if somebody can pitch in for help. Thanks in Advance.

Best Regards,

Kaushal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20180829/7f24ece8/attachment.html>


More information about the nginx mailing list