On my Windows 11 machine I've created a Hyper-V VM and installed Ubuntu 20.04 on it.
I run an Nginx Docker container on the VM and map port 80 to port 8080 on the machine with the command
docker run --rm -d -p 8080:80 nginx
I can then use curl on the Windows host to access Nginx using
curl http://my-vm:8080/
But if I try opening the http://my-vm:8080/ URL in a browser (I've tried Chrome and Edge), the connection times out.
I can see the curl request in the Nginx log, but nothing from the browser requests.
Any help getting it to work will be appreciated.
Update: If I use the IPv6 address of the VM (http://[fe80::204b:b831:d148:58aa]/) in the browser it works, but if I use the IPv4 address (http://172.17.196.155/), it doesn't.
I think it may be Docker related. Connections to software on the VM seems to work. It's software in a container on the VM that doesn't work.
my-vm
to the IP addresses. I've found them usingping -4 my-vm
andping -6 my-vm
.