nginx禁止访问某个后缀名的文件
web项目中一些配置文件比如ini文件,cfg文件,或者静态的模板dwt、lbi文件等,需要设置禁止访问,不然可以直接在browser上下载。
location ~* \.(ini|docx|txt|doc)$ { 
     deny all; 
} 
location ~* \.html$ {
     deny all;
}
web项目中一些配置文件比如ini文件,cfg文件,或者静态的模板dwt、lbi文件等,需要设置禁止访问,不然可以直接在browser上下载。
location ~* \.(ini|docx|txt|doc)$ { 
     deny all; 
} 
location ~* \.html$ {
     deny all;
}
