You are not logged in.

#1 2021-11-03 18:19:16

Lockheed
Member
Registered: 2010-03-16
Posts: 1,542

VM guest cannot connect to nginx in docker on same host

I have a libvirt Win10 guest which can ping and connect to the Arch host. However, this Arch host also hosts a container of Nginx reverse proxy manager, which servers several www domains pointing to other docker containers on the same host (various web services, including Jellyfin, utorrent etc).

Every other machine in the network can connect to those services through their www domains in a web browser, except that Windows VM running on this server: when I try to go to any of those URLs, the browser tries to resolve it for about a minute and then times out.

How can I fix it?

Offline

#2 2021-11-03 19:17:55

dreamycrane
Member
Registered: 2019-03-18
Posts: 25

Re: VM guest cannot connect to nginx in docker on same host

Either have the docker container run in the LAN or if it is using one of these docker internal NAT networks use the physical hosts iface to route traffic from the VM to the docker containers.

And in the VM's /etc/hosts register an entry for the docker nginx container.

Last edited by dreamycrane (2021-11-03 19:53:39)

Offline

#3 2021-11-03 19:56:58

Lockheed
Member
Registered: 2010-03-16
Posts: 1,542

Re: VM guest cannot connect to nginx in docker on same host

VM is bridged to a br0 interface on host, which is also the one getting the IP for the host (br0 is bridged to eth0, but the br0 is the one with the IP, not eth0. So I am not sure what you meant, but I don't feel changes in network interfaces is the way.

Thanks, as the trick with editing hosts file worked.
However, I'd prefer it to have it work properly rather than manually add a redirect for every new service.

Offline

#4 2021-11-03 22:36:10

dreamycrane
Member
Registered: 2019-03-18
Posts: 25

Re: VM guest cannot connect to nginx in docker on same host

Is the VM and the docker container running on the same network?
Ok the VM is running in the same network with the the host since you mentioned your are using a bridge and not NAT BUT how about the docker container.?
Most probably the VM does not know how to reach the docker container IP and therefore the URL.
Are the URLs resolvable to the docker container?
Do you use some DNS service?
Stil if they are in different network you need to use routing.

Offline

Board footer

Powered by FluxBB