错误日志如下
2019/02/22 12:14:11 [error] 24225#0: *10768 FastCGI sent in stderr: "Access to the script '/var/www/html/ad-server/manifest.json' has been denied (see security.limit_extensions)" while reading response header from upstream, client: 42.200.169.121, server: test.gadmobe.com, request: "GET /manifest.json HTTP/1.1", upstream: "fastcgi://127.0.0.1:9003", host: "test.gadmobe.com", referrer: "http://test.gadmobe.com/push/webpush-content.php?debug=1"
检查文件是否存在 & 权限
说明:文件存在 以及 权限没问题
$ ll /var/www/html/ad-server/manifest.json
-rwxr-xr-x 1 www www 77 Feb 22 11:34 /var/www/html/ad-server/manifest.json
解决
说明:根据错误日志出现security.limit_extensions 的错误,经过查找资料发现从5.3.9开始,php官方加入了一个配置"security.limit_extensions",默认状态下只允许执行扩展名为".php"的文件,造成了其他类型的文件不支持的问题
$ vim /usr/local/php-fpm/etc/php-fpm.conf
#将.json放在后面
security.limit_extensions=.php .html .js .css .jpg .jpeg .gif .png .htm .ico .json
#重启php就解决啦