nginx禁止访问某个后缀名的文件

猛然发现通过http://ip:端口号/路径/config.ini竟然能下载项目代码的配置文件,检查nginx配置,原来是没有加限制,立即加上,并记录如下:

location ~* \.(ini|docx|txt|doc)$ {  
     deny all;  
} 

 转载:http://blog.csdn.net/ligaofeng/article/details/44872011

posted on 2015-08-05 02:28  今天又进步了  阅读(3908)  评论(0编辑  收藏  举报

导航