I am using an automated docker-image for php-fpm and nginx (https://hub.docker.com/r/tobi312/rpi-php/ and https://hub.docker.com/r/tobi312/rpi-nginx/ ) running on a raspberry pi with with libreelec on top.
The php container successfully starts with port 9000 open by running the following command:
docker run --name php -v /var/www/restTools:/var/www/html -d 3dd6ff8c0d58
After that I started the nginx-container like this:
docker run --name nginx -d -p 8081:80 --link php:9000 -v /var/www/restTools:/var/www/html 0d90cc6eb00f
Both containers are running but the nginx is not executing php files, it's just offering them for download.
After a while I tried to commit the connection details to the php-container trough a default.conf
by adding -v /var/www/.config/nginx:/etc/nginx/conf.d:ro
to the command.
Excerpt from default.conf
:
root /var/www/html;
location / {
root /var/www/html;
index index.html index.htm index.php;
}
location ~ \.php$ {
root /var/www/html;
fastcgi_pass php:9000;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_param REMOTE_ADDR $http_x_real_ip;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
include fastcgi_params;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
}
What am I missing?