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

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

本文介绍如何通过修改cloudlab.conf配置文件,禁止访问特定类型的文件,如.user.ini、.htaccess等,并说明了如何重启openresty服务使更改生效。

5219

被折叠的 条评论
为什么被折叠?



