`curl: (7) Failed to connect to 10.0.2.15 port 8080: Connection refused`
BeginnerTroubleshootingConnectivity: refused, timed out, no route
Answer
Likely causes → The packet reached the host and the kernel answered with a TCP RST: nothing is listening on that port, the app is bound to 127.0.0.1 only, or a local firewall rule uses REJECT --reject-with tcp-reset.
Diagnose →
# on the server
ss -ltnp | grep 8080
systemctl status myapp
sudo iptables -S | grep -i reject
Fix → Start the service, or change the bind address from 127.0.0.1 to 0.0.0.0 (or the specific interface IP). Remove the reject rule if it is unintended.
Prevent → Add a readiness check that verifies the port is listening, and alert on process restarts.
More on Connectivity: refused, timed out, no route
`curl: (28) Failed to connect to api.internal port 443 after 130001 ms: Connection timed out`Beginner`ssh: connect to host 10.1.4.20 port 22: No route to host`BeginnerService works with `curl localhost:3000` on the box but times out from other hosts.Beginner`ping` works but `curl` to port 80 on the same host times out.Beginner`curl` to a public site works, but `ping 8.8.8.8` shows 100% packet loss.Beginner`nc: connect to db.internal port 5432 (tcp) failed: Connection refused`, yet PostgreSQL is running.Beginner