PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, April 20, 2022

[FIXED] Why docker container on specific port return connection refused?

 April 20, 2022     connection, docker, port, vps     No comments   

Issue

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.

even using 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?


Solution

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



Answered By - Pavel Trzaskalik
Answer Checked By - Senaida (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing