nginx使用location设置某些目录不能访问php文件

#代码如下:
#在nginx.conf的server配置里面写上
#public/bd 不能访问的路径

location ~* ^/(public/bd)/.*.(php|php5)$ {
         deny all; 
}
#nginx -s reload 一般用这个比较合理==重启过程不会影响
Service nginx restart

#更多详细过程请看视频

Nginx使用location设置某些目录不能访问php文件

发布了29 篇原创文章 · 获赞 25 · 访问量 2205

猜你喜欢

转载自blog.csdn.net/wnw001/article/details/104495899