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