docker+nginx+php-fpmでFastCGI sent in stderr

Aug 25, 2020 nginx Docker php-fpm

The following error occurs according to the title
[error] 8#8: *25 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream

When I checked variously in “Primary script unknown”, I found that the setting in nginx.conf

fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
↓
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

There were many articles, but it was almost all, but the cause was different. It was a more fundamental mistake.

###!! The path of nginx volume and php-fpm volume are different. !!

in nginx /var/www/app/{full contents of app}

In php-fpm /var/www/{full contents of app}

It seems that the app is missing and there is an error.

It’s simple, but it took time, so I’ll leave it in the article.