curl to an internal service on an EC2 instance hangs (timeout, not refused). Debug it.
AdvancedHands-onLive debugging tasks
Answer
curl -v --connect-timeout 5 http://10.0.2.15:8080/health
nc -vz -w 3 10.0.2.15 8080
# on the target:
sudo ss -ltnp | grep 8080 # listening, and on 0.0.0.0?
sudo iptables -L -n | head; sudo ufw status
# in AWS: security group inbound 8080 from the source SG/CIDR, NACL both directions, route tables
Key trick → "Refused" means the packet arrived and nothing was listening (or a host firewall sent a reject). A timeout means packets were dropped silently, which in AWS is almost always a security group or NACL. Remember NACLs are stateless and need the ephemeral return ports allowed.
More on Live debugging tasks
A pod is in CrashLoopBackOff. You have 10 minutes. Walk through your commands.BeginnerThe pod shows `OOMKilled`. Diagnose and fix it.BeginnerA pod is stuck in `ImagePullBackOff`. Fix it.BeginnerA pod is `Pending` forever. What do you check?AdvancedThe Service returns "connection refused" but pods are Running. Debug it.IntermediateA Docker container exits immediately after `docker run -d`. Find out why.Beginner