Good time of day. I got to Nginx setup with FastCGI on Fedora 24, but Nginx writes

2016/12/21 08:12:51 [error] 3427 # 0: * 4 FastCGI sent in stderr: "Primary script unknown" while reading the response header from upstream, client: 127.0.0.1, server: yaboku.ru.local, request: "GET / HTTP / 1.1", upstream: "fastcgi: //127.0.0.1: 9000", host: "yaboku.ru.local"

Google is the second hour, everything is useless, the path is correct

server { listen 80; server_name yaboku.ru.local; access_log /var/log/nginx/yaboku-nginx-access.log; error_log /var/log/nginx/yaboku-nginx-error.log; root /home/zaars/Project/Yii2/yaboku.ru/web; location / { index index.php index.html index.htm; } location ~ \.php$ { include fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_$ } } 

I do not know what the problem is ....

    2 answers 2

    Thanks, I found the solution myself. The problem was in the php-fpm config: changed the user from the default apache to the one under which the server is running, and it all worked.

    Thank :)

      Try this

       set $yii_bootstrap "index.php"; location / { index index.html $yii_bootstrap; try_files $uri $uri/ /$yii_bootstrap?$args; } location ~ \.php { fastcgi_split_path_info ^(.+\.php)(.*)$; set $fsn /$yii_bootstrap; if (-f $document_root$fastcgi_script_name){ set $fsn $fastcgi_script_name; } fastcgi_pass 127.0.0.1:9000; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fsn; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fsn; location ~ /\.ht { deny all; return 404; } } 
      • Alas, this option did not change the result of the work ( - Za Ars
      • This is very strange, this particular config works for me. Perhaps the problem is in the fpm settings. Try to connect via unix-socket - ilyaplot