NGINX Proxy Manager cannot resolve hostnames from docker reddit / selfhosted ---------------------------------------------------------------------- CtKairos ยท 2023-12-13 20:31 Hello! I've been banging my head on this for quite a while: I've got NGINX Proxy Manager set up with Pihole to make it easier to access my internal services (nothing is exposed to the public for now). Every docker container I have is on the same server. I've managed to get it all working, except for in the proxy hosts of NPM I for some reason can't use hostnames from docker containers in the IP Address., even though they are on the same docker network. I've tried both ways for the docker network, all services added to the NPM network or NPM added to individual networks, but both have issues with resolving the hostnames. I've checked the hostnames with `docker exec -it hostname` and checked the docker network with `docker network inspect ` and I've also tried inside of nginx container to curl the hostname like this `docker exec -it nginx curl http://service_name` and ping it and both seem to be working fine. The weirdest part is some of the hostnames do resolve and npm successfully proxies to the correct address, but not all. For example, here is my docker compose for my two radarr instances: ``` version: "3.8" services: radarr: image: lscr.io/linuxserver/radarr hostname: radarr container_name: radarr environment: - PUID=${PUID} - PGID=${PGID} - TZ=${TZ} - UMASK=002 volumes: - ${BASE_DOCKER_DATA}/radarr/hd:/config - /mnt/shared/data:/data restart: unless-stopped ports: - 7878:7878 networks: - media-network radarr4k: image: lscr.io/linuxserver/radarr hostname: radarr4k container_name: radarr4k environment: - PUID=${PUID} - PGID=${PGID} - TZ=${TZ} - UMASK=002 volumes: - ${BASE_DOCKER_DATA}/radarr/uhd:/config - /mnt/shared/data:/data restart: unless-stopped ports: - 7879:7878 networks: - media-network networks: media-network: name: media-network external: true ``` both are defined exactly the same, but the non4k one can be accessed by hostname while the other cannot, which is super strange (media network is declared elsewhere). Here is my nginx proxy manager compose if it helps too: ``` version: '3.8' services: nginx: container_name: nginx hostname: nginx image: 'jc21/nginx-proxy-manager:latest' restart: unless-stopped ports: # These ports are in format : - '80:80' # Public HTTP Port - '443:443' # Public HTTPS Port - '81:81' # Admin Web Port volumes: - ${BASE_DOCKER_DATA}/nginx/data:/data - ${BASE_DOCKER_DATA}/nginx/letsencrypt:/etc/letsencrypt environment: - PUID=${PUID} - PGID=${PGID} networks: - proxy_net - media-network networks: proxy_net: driver: bridge name: proxy_net media-network: name: media-network external: true ``` please let me know if I am doing something stupid here or I am missing something, this is all super new to me and I am sure I missing something in here! :)