502 Gateway Error using Adguard and NPM on Docker MACVLAN reddit / selfhosted ---------------------------------------------------------------------- StrawberryBlind · 2023-10-10 09:33 Hi everyone, hope your tuesday is going well. I imagine as a community we are very sick of the problem I'm trying to solve here but I can't seem to see where I'm going wrong despite looking through tens of other resolutions with a similar issue and would love some clarity. I'm running a docker instance with several containers running my arr/jellyfin stack, DNS and NPM. I've set up two separate stacks for my adguard instance and my NPM instance. both of which are connected to my MACVLAN network so they get two separate IPs. I'm not exposing anything to the WAN, just keeping this all local. I just want local DNS-port resolution. * Domain name: vs.local * Adguard: 192.168.0.200 - my router points all devices to this address and resolves fine. This is on mainnetwork-macvlan within Docker. * NPM: 192.168.0.201 - This is on mainnetwork-macvlan within Docker. * arr/jellyfin stack: 192.168.0.5: - this has a shared bridge network called UN on 172.30.0.0/16, this works fine. * Docker host: 192.168.0.5 Within Adguard I've set a wildcard rewrite to NPM as *.vs.local pointing to 192.168.0.201 Within NPM I have a test proxy host called sonarr.vs.local, pointing to http://192.168.0.5:8989. When I try to navigate to sonarr.vs.local I just get a 502 bad gateway error. My two compose files for Adguard and NPM are below: **Adguard** networks: mainnetwork-macvlan: external: true version: "latest" services: adguardhome: image: adguard/adguardhome restart: unless-stopped container_name: adguardhome logging: options: max-size: "10m" max-file: "3" ports: - 53:53/tcp - 53:53/udp - 784:784/udp - 853:853/tcp - 3000:3000/tcp - 80:80/tcp volumes: - /home/jupiter/docker/adguardhome/work:/opt/adguardhome/work - /home/jupiter/docker/adguardhome/conf:/opt/adguardhome/conf networks: mainnetwork-macvlan: ipv4_address: 192.168.0.200 **NPM** networks: mainnetwork-macvlan: external: true version: '3.8' services: app: image: 'jc21/nginx-proxy-manager:latest' restart: unless-stopped ports: - '80:80' # Public HTTP Port - '443:443' # Public HTTPS Port - '81:81' # Admin Web Port # - '21:21' # FTP volumes: - ./data:/data - ./letsencrypt:/etc/letsencrypt networks: mainnetwork-macvlan: ipv4_address: 192.168.0.201 I can access the UI of adguard and NPM, but the forwarding does not seem to work. I've seen some information about them both using port 80, but as they're on their own addresses I thought this wouldn't conflict. As well, they should be able to communicate with each other across the network as if they're two seperate devices. Additionally, because the arr stack is on its own 192.168.0.5 address, NPM should be able to navigate back to that like normal? Any help or direction you can provide me would be massively helpful. Thank you guys! ---------------------------------------------------------------------- thekrautboy · 2023-10-10 09:39 /r/NginxProxyManager and /r/Docker? ---------------------------------------------------------------------- StrawberryBlind · 2023-10-10 09:41 Thank you, I have crossposted these. ---------------------------------------------------------------------- ElevenNotes · 2023-10-10 10:57 Docker host can't communicate with MACVLAN containers, are you aware of that? ---------------------------------------------------------------------- StrawberryBlind · 2023-10-10 12:52 Oh! Thank you - would this mean for the ones hosted on x.x.x.5 I would have to add another network and use the IPs on that network? ---------------------------------------------------------------------- codenamek83 · 2023-10-10 14:07 By design this is not possible however there is a workaround for this. MACVLAN Shim network will solve your solve your problem. Google for "MACVLAN Shim". Check: https://blog.ivansmirnov.name/set-up-pihole-using-docker- macvlan-network/ ---------------------------------------------------------------------- StrawberryBlind · 2023-10-10 17:35 Thank you, I'll do some research! ---------------------------------------------------------------------- thekrautboy · 2023-10-10 18:07 Thanks so much for sharing this!! Now i can finally solve my annoying little problem that i run Pihole as macvlan and as a result the "Homepage" dashboard widget running on the same Docker host cant read stats from it. TIL :)