dockernginxdocker-composenextcloud

Docker nginx reverse proxy can't resolve hostname


I'm trying to setup nextcloud with a nginx reverse proxy in front of it. Therefore I'm using docker compose, with one service each. All containers are in the same network (nextcloud-aio).
If I attach to the nginx container, install ping and ping the hostname nextcloud-aio-mastercontainer everything works just fine. But if I access the webserver, it logs no resolver defined to resolve nextcloud-aio-mastercontainer.
I just mounted the working nginx configuration to the docker-container and changed the hostname for the proxy_pass from 127.0.0.1 to nextcloud-aio-mastercontainer. the proxy_pass inside the container is now proxy_pass http://nextcloud-aio-mastercontainer:11000$request_uri;
I've read about wrong reolv.conf files, but I guess, the ping should fail also if thats the problem.
Just for the case somebody asks, this is my /etc/resolv.conf inside the container:

nameserver 127.0.0.11
options ndots:0

Hopefully somebody has an idea I could try


Solution

  • I solved it by adding resolver 127.0.0.11 ipv6=off; to the nginx.conf and replaced nextcloud-aio-mastercontainer with nextcloud-aio-apache. It works like a charm now