Hi everyone, I’m struggling with a networking issue and could really use some guidance.
I’m running a UGREEN NAS with this setup:
- Ubuntu 24.04 VM that I can access at 192.168.1.99 on my local network
- Nginx Proxy Manager running in a Docker container through Portainer.
I’m trying to configure a proxy rule in NPM so that when someone visits mysite.example.com, it forwards the request to my Ubuntu VM at 192.168.1.99:80. However, the connection isn’t working at all.
From what I’ve been reading online, it seems like this might be a Docker networking problem where the container can’t communicate with devices outside of its Docker network. The VM is definitely reachable from other devices on my network, but NPM just can’t seem to connect to it.
Has anyone dealt with this type of Docker to VM connectivity issue before? What’s the best way to allow my containerized proxy manager to reach my virtual machine?
I had the same issue with containers on my Synology NAS. Docker creates its own subnet that can’t reach your LAN addresses directly. Don’t mess with network modes - just use your NAS host’s IP as a middleman. Set NPM to forward to your UGREEN NAS IP (like 192.168.1.50) on a specific port, then configure port forwarding on the NAS to redirect that traffic to your VM at 192.168.1.99:80. This keeps Docker’s network isolation intact while creating the connection path you need. Also check that your VM’s firewall isn’t blocking connections from your NAS subnet.
It seems like Docker’s default network isolation could be preventing your connection. Consider using --network host in your Docker run command, which allows your container to share the host’s network stack. If you’re working with Docker Compose, you can implement network_mode: host in the service definition. Additionally, verify that your UGREEN NAS isn’t applying any firewall restrictions that might block this connection. For troubleshooting, you might want to attempt accessing the VM from within the NPM container to pinpoint the issue.
check if your docker container’s using bridge networking - that’s usually what causes this. create a custom bridge network with docker network create --driver bridge mynetwork then run npm with --network mynetwork. also make sure port 80 isn’t blocked on your ubuntu vm. you might need to tweak iptables or ufw settings.