stat() “xxx” failed (13: Permission denied)
# /home/yiqin/log/nginx/error.log
2020/09/10 09:22:43 [crit] 12358#0: *16171 stat() "/home/yiqin/oms-backend/web/index.html" failed (13: Permission denied), client: 192.168.2.191, server: yiqin.oms-backend.com, request: "GET /index.html HTTP/1.1", host: "yiqin.oms-backend.com"
2020/09/10 09:22:43 [crit] 12358#0: *16171 stat() "/home/yiqin/oms-backend/web/index.html" failed (13: Permission denied), client: 192.168.2.191, server: yiqin.oms-backend.com, request: "GET /index.html HTTP/1.1", host: "yiqin.oms-backend.com"
2020/09/10 09:22:43 [error] 12358#0: *16171 FastCGI sent in stderr: "Unable to open primary script: /home/yiqin/oms-backend/web/index.php (No such file or directory)" while reading response header from upstream, client: 192.168.2.191, server: yiqin.oms-backend.com, request: "GET /index.html HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "yiqin.oms-backend.com"
# /home/yiqin/oms-backend
# /usr/local/nginx/conf/vhost/yiqin.oms-backend.conf
server {
listen 80;
server_name yiqin.oms-backend.com;
root /home/yiqin/oms-backend/web;
access_log /home/yiqin/log/nginx/access.log;
error_log /home/yiqin/log/nginx/error.log;
location / {
index index.php;
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
# 权限
drwxr-xr-x 3 root root 4096 9月 10 09:03 log
drwxr-xr-x 12 yiqin www 4096 9月 10 09:03 oms-backend
-rw-r--r-- 1 root root 521 9月 10 09:06 yiqin.oms-backend.conf
应该还是权限问题,yiqin账号是当前分配的,另一天来,可能是服务重启了,然后,权限分配好了。然后一切就正常了。