Situation
I'm trying to learn how to use docker on my local machine. The local machine is set up to only route traffic through a VPN. The default UFW policy is to DENY
all incoming and outgoing traffic (except through a VPN).
Problem
When I try to launch a Docker container docker container run -p 80:80 nginx
, I cannot connect to the nginx container using localhost in my browser.
However, I can connect to the local nginx container through telnet
$ telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
The reason I know that UFW may be causing this is because once I disable UFW, I'm able to connect to localhost in the browser with no problem.
Question
How do I connect to my local nginx container from my browser when UFW is set to deny all connections?