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

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

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

慕田峪4524236 2018-12-04 09:04:59
nginx中怎么禁止目录PHP执行权限
查看完整描述

1 回答

?
慕斯709654

TA贡献1840条经验 获得超5个赞

首先,编辑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-12-08
  • 1 回答
  • 0 关注
  • 578 浏览

添加回答

举报

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