I'm trying to access https://test.httpapi.com webservice from one of my Amazon EC2 instances running Basic Amazon Linux AMI. This is the output of the nc command:
[root@ec2-instance]# nc -v test.httpapi.com 80
nc: connect to test.httpapi.com port 80 (tcp) failed: No route to host
[root@ec2-instance]# nc -v test.httpapi.com 443
nc: connect to test.httpapi.com port 443 (tcp) failed: No route to host
[root@ec2-instance]# nc -v test.httpapi.com 22
nc: connect to test.httpapi.com port 22 (tcp) failed: Connection refused
So, I get 'no route to host' when I try ports 80 or 443, but 'connection refused' when I try ssh port 22 (which is expected).
However, if I try from my local machine (running Ubuntu linux), I can successfully connect to ports 80 and 443:
me@my-laptop$ nc -v test.httpapi.com 80
Connection to test.httpapi.com 80 port [tcp/www] succeeded!
me@my-laptop$ nc -v test.httpapi.com 443
Connection to test.httpapi.com 443 port [tcp/https] succeeded!
me@my-laptop$ nc -v test.httpapi.com 22
nc: connect to test.httpapi.com port 22 (tcp) failed: Connection refused
iptables is disabled on the EC2 instance.
What could be the problem here?