docker-compose the nginx can access html php can not access prompt File not found.?

These days engaged docker-compose the nginx + php environment, you can build a good appearance after a visit .html files, but can not access .php file

 

 

The first: There is no parsing php file

1: Change profile nginx.conf 
fastcgi_param SCRIPT_FILENAME / scripts $ fastcgi_script_name; 
replaced by the following (that is, put your root folder to allow other users)

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

2: Note fastcgi_pass

 

 Because docker-compose.yml in php of services called php-fpm, so here is a php-fpm: 9000

The first: data volume mount problem

Nginx php and remember to mount in the same data volume below

 

Guess you like

Origin www.cnblogs.com/jxxiaocao/p/12111498.html