FastCGI sent in stderr: “Primary script unknown” while reading

  docker, question

Multi-container constructionphp-fpm+nginxIn the testnginxIs the configuration of successful andfpmWhen connected, visiturl,

Every timeFile not found.

nginxThe log of is as follows:

clipboard.png

Core issues:FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream

docker logs php-fpmThe log of is as follows:

clipboard.png

nginxThe log of is as follows:

server {
 listen       80;
 server_name  localhost;
 root /usr/share/nginx/html/;
 index  index.php  index.html  index.htm ;
 
 location / {
 try_files $uri $uri/ =404;
 }
 
 location ~ \.php$ {
 fastcgi_pass   php_180227_7.1.0:9000;
 fastcgi_index   index.php ;
 fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
 include        fastcgi_params;
 }
 
 location ~ /\.ht {
 deny  all;
 }
 }

nginxThe shared directory of is as follows (/home/docker_lnmp/nginx/www:/usr/share/nginx/html):

clipboard.png

phpThe shared directory of is as follows (/home/docker_lnmp/nginx/www:/var/www/html):

clipboard.png

nginxConfiguration fileconfigIn

fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

To be replaced by

fastcgi_param  SCRIPT_FILENAME  /var/www/html$fastcgi_script_name;

Otherwise ..php fastcgiUnable to parse directory