Docker Community Forums

Share and learn in the Docker community.

Official Nextcloud Repo results in Connection refused

I followed https://docs.docker.com/samples/library/nextcloud/ to setup nextcloud using the linked nginx.conf and everything like in that howto.

Unfortunately, when accessing the site, it just displays “502 Bad Gateway” and the nginx container lists an error:
[error] 6#6: *1 connect() failed (111: Connection refused) while connecting to upstream, client: x.x.x.x, server: , request: "GET / HTTP/1.0", upstream: "fastcgi://172.26.0.2:9000"

For debugging I did two things:

  • I opened port 9000 of the nextcloud:fpm container
  • I added a busybox container in the same docker network

So, running telnet localhost 9000 from docker host now succeeds.
While running telnet app 9000 or telnet 172.26.0.2 9000 from busybox container fails.
(“app” is the docker hostname for the fpm container, 172.26.0.2 is the IP of that container. Ping works.)

Why is fpm accessible from the host network, but not from the very same docker network it resides is?
What can I do to figure it out?
What else do you need to help me?