在nginx要禁止某个或一类资源,只需要在nginx.conf增加一个location,然后在其中使用deny all即可,
1.禁止访问扩展名为bat的文件,配置如下:
location ~* /.bat {
deny all;
}
2.禁止访问configs目录,以及其下所有子目录或文件,配置如下:
location ^~ /configs/ {