Multi-container constructionphp-fpm
+nginx
In the testnginx
Is the configuration of successful andfpm
When connected, visiturl
,
Every timeFile not found.
nginx
The log of is as follows:
Core issues:FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream
docker logs php-fpm
The log of is as follows:
nginx
The 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;
}
}
nginx
The shared directory of is as follows (/home/docker_lnmp/nginx/www:/usr/share/nginx/html
):
php
The shared directory of is as follows (/home/docker_lnmp/nginx/www:/var/www/html
):
nginx
Configuration fileconfig
Infastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
To be replaced by
fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name;
Otherwise ..
php fastcgi
Unable to parse directory