stat() “xxx” failed (13: Permission denied)

  1. # /home/yiqin/log/nginx/error.log
  2. 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"
  3. 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"
  4. 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"
  5. # /home/yiqin/oms-backend
  6. # /usr/local/nginx/conf/vhost/yiqin.oms-backend.conf
  7. server {
  8. listen 80;
  9. server_name yiqin.oms-backend.com;
  10. root /home/yiqin/oms-backend/web;
  11. access_log /home/yiqin/log/nginx/access.log;
  12. error_log /home/yiqin/log/nginx/error.log;
  13. location / {
  14. index index.php;
  15. try_files $uri $uri/ /index.php$is_args$args;
  16. }
  17. location ~ \.php$ {
  18. fastcgi_pass 127.0.0.1:9000;
  19. fastcgi_index index.php;
  20. include fastcgi_params;
  21. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  22. }
  23. }
  24. # 权限
  25. drwxr-xr-x 3 root root 4096 9 10 09:03 log
  26. drwxr-xr-x 12 yiqin www 4096 9 10 09:03 oms-backend
  27. -rw-r--r-- 1 root root 521 9 10 09:06 yiqin.oms-backend.conf

image.png
应该还是权限问题,yiqin账号是当前分配的,另一天来,可能是服务重启了,然后,权限分配好了。然后一切就正常了。

参考https://cloud.tencent.com/developer/ask/54842