为了账号安全,请及时绑定邮箱和手机立即绑定

nginx中怎么禁止目录PHP执行权限?

nginx中怎么禁止目录PHP执行权限?

大话西游666 2018-10-25 10:06:12
nginx中怎么禁止目录PHP执行权限
查看完整描述

1 回答

?
撒科打诨

TA贡献1934条经验 获得超2个赞

首先,编辑nginx的虚拟主机配置,在fastcgi的location语句的前面添加如下内容:
1、单个目录去掉PHP执行权限
location ~ /attachments/.*.(php|php5)?$ {
deny all;
}
将attachments目录的PHP执行权限去掉。

2、多个目录去掉PHP执行权限
ocation ~ /(attachments|upload)/.*.(php|php5)?$ {
deny all;
}
将attachments、upload这二个目录的PHP执行权限去掉。

查看完整回答
反对 回复 2018-11-19
  • 1 回答
  • 0 关注
  • 944 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信