Asked By: Anonymous
I have a Linux VPS with docker installed, I ran an Nginx docker container on a specific port using flag -p, when I try connecting to it using VPS_IP:PORT always get Connection_Refused.
curl http://localhost:PORT return connection refused.
Except for port 80, every other port refuses to connect, though ufw is disabled.
docker container command I used:
docker container run -d -it -p 83:83 --name container_name -v /home/.../:/container_path/ nginx
Any thoughts on how to solve this problem?
Answered By: Anonymous
Correct docker container command is :
docker container run -d -it -p 83:80 --name container_name -v /home/.../:/container_path/ nginx
Because Nginx docker image is listening on internal port 80