nginx prevent file download

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


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 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,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list