For me, none of here mentioned solutions ever worked. I had to install php-fpm in the nginx container and use its unix (file) socket instead of tcp socket to fpm container.