禁用nginx访问和下载文件(web.config和\.htaccess)

1、 vim /usr/local/openresty/nginx/conf/conf.d/cloudlab.conf
##修改 location ~ ^/(.user.ini|.htaccess|.git|.project|LICENSE|README.md|web.config)
{
return 404;
}

2、重启服务生效:systemctl restart openresty
禁用nginx访问和下载文件(web.config和\.htaccess)

或者是在vim /etc/nginx/nginx.conf 中修改
验证访问不到了 systemctl restart nginx

禁用nginx访问和下载文件(web.config和\.htaccess)