本文摘自PHP中文网,作者V,侵删。
配置nginx禁止目录执行php文件的方法:【location ~ /dir/.*.(php|php5)?$ {deny all;}】。配置完成后需要重启web服务。

禁止dir目录执行php文件权限
(推荐教程:nginx教程)
1 2 3 | location ~ /dir/.*.(php|php5)?$ {
deny all;
}
|
多个目录
(学习视频推荐:php视频教程)
禁止dir和upload目录执行php文件权限
1 2 3 | location ~ /(dir|upload)/.*.(php|php5)?$ {
deny all;
}
|
配置完成后重启web服务。
以上就是怎样配置nginx禁止目录执行php文件的详细内容,更多文章请关注木庄网络博客!
相关阅读 >>
php程序员最用的开发工具10年老程序员的推荐
nginx有哪些常见的应用场景
nginx在做负载均衡时如何配置文件
502 bad gateway nginx什么意思
linux系统下简单操作--查看文件、目录属性
nginx哪个版本好
linux怎么开启php
nginx负载均衡参数有哪些
怎么更改nginx配置文件
存放linux基本命令的是什么目录
更多相关阅读请进入《nginx》频道 >>
转载请注明出处:木庄网络博客 » 怎样配置nginx禁止目录执行php文件