on Ali CVM, deploy the php development environment using the docker-ce version. After deploying nginx and php-fpm, the end file of the test. Html can be accessed, but the test .php file will report an error as follows:
File not found.
check the nginx error log of docker, and the error is as follows:
FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream
check the php-fpm log under docker. The error is as follows:
[27-Apr-2018 02:58:49] NOTICE: fpm is running, pid 1
[27-Apr-2018 02:58:49] NOTICE: ready to handle connections
172.17.0.3-27/Apr/2018:02:59:26 + 0000 "GET / index.php" 404
execute the following installation nginx and PHP commands:
nginx:docker run-p 808080 docker/nginx/conf/nginx.conf:/etc/nginx/nginx.conf:ro 80-- name my_nginx-v / docker/nginx/conf/nginx.conf:/etc/nginx/nginx.conf:ro-v / docker/nginx/conf/conf.d/:/etc/nginx/conf.d/-v / docker/nginx/logs/:/var/log/nginx/-v / docker/www/myBlog/:/var/html/-- link my_php-fpm-d nginx:1.13
php:docker run-p 9072 docker/www/myBlog:/www 9000-- name my_php-fpm-v / docker/php/conf/php.ini:/etc/php.ini:ro-v / docker/www/myBlog:/www-d php:7.1-fpm
The configuration file fornginx is as follows: