Unable to access Nginx

Hi All,

I installed nginx and made it running in 8888 port.

I made sure using docker inspect nginx, got the IP address of that container.

but when I type it in browser, it says unable to connect!

when I check the port in the computer it’s up and running (using netstat)

Not sure what have to do.

Can you share your docker run command line or docker-compose.yml fragment? You should be able to access it via your physical host’s DNS name or IP address, using the first port number you specified in the docker run -p option or the Docker Compose ports: block.

That IP address is useless for many purposes. I extremely rarely run docker inspect and you don’t need it for most standard things.

You have to expose this port using “-p” in your “docker run” statement. Like this:

docker run -p 80:8888 -d <your/image:tag>

Than you can access nginx on localhost:8888