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

tp5 nginx 静态目录下文件夹名称为php时出现403 Forbidden

tp5 nginx 静态目录下文件夹名称为php时出现403 Forbidden

PHP
慕工程0101907 2019-03-05 21:52:19
如题,静态目录下文件夹名称为php下的 .php 文件访问出现403 Forbidden,但是其他文件格式如html、js等文件范文正常,文件夹名称不为php的所有文件访问都正常(包括php文件) nging配置文件如下 server { listen 80; server_name xxx.xxx.com; #access_log /data/wwwlogs/xxx.xxxx.log combined; #error_log /data/wwwlogs/xxx.xxxxx_error.log; set $root /data/www/tp5/public; location ~ \.php { fastcgi_pass 127.0.0.1:9000; fastcgi_split_path_info ^((?U).+.php)(/?.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $root$fastcgi_script_name; include fastcgi_params; } location ~ .*\.(gif|jpg|jpeg|bmp|png|ico|txt|js|css)$ { root $root; } location / { root $root; index index.html index.php; if ( -f $request_filename) { break; } if ( !-e $request_filename) { rewrite ^(.*)$ /index.php/$1 last; break; } } }
查看完整描述

1 回答

?
慕姐4208626

TA贡献1852条经验 获得超7个赞

应该是目录权限的问题。 把 public 目录的 读写权限打开 改成 777

查看完整回答
反对 回复 2019-03-18
  • 1 回答
  • 0 关注
  • 721 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号