nginx报错如下
2019/05/05 07:34:51 [error] 9977#9977:
*14 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream,
client: 223.104.64.224,
server: ***.top,
request: "POST /api/index HTTP/1.1",
upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:",
host: "***.top"
nginx配置
server {
listen 80;
server_name ***.top;
set $root_path '/var/www/html/douyin_laravel/public';
root $root_path;
index index.php index.html index.htm;
try_files $uri $uri/ @rewrite;
location @rewrite {
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php {
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index /index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path;
}
location ~ /\.ht {
deny all;
}
}
执行 ps aux|grep php
结果
项目目录权限也都是777
我看网上的解决办法都是这样的链接描述 但是我看了一下我nginx配置中我本来就有这句话fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name
;
大家能帮我看看是哪里的问题吗?
我的就是这样配置的 即可