Search code examples
amazon-web-servicesnetwork-programmingamazon-ec2amazon-vpcamazon-ami

Cannot use HTTP to connect to AWS ec2 jupyter notebook --port 80?


I launched an EC2 instance using AMI "Deep Learning AMI (Amazon Linux 2) Version 29.1 - ami-0785b5da651a70c82", set the inbound rule to:

"HTTP   TCP 80  0.0.0.0/0"
"SSH    TCP 22  0.0.0.0/0"

I can ssh to the host, and started jupyter notebook --port 80. On the ec2 instance, I can get page back using wget localhost.

But I just can't connect from outside the AWS. From my java client to connect to the host with port 80, I got "Connection refused". When connecting through browser, I got site not exist error.

I really confused, wondering how to trace this connectivity issue. Seems AWS added a lot of magic, including VPC, gateway, subnet, NAT and etc, I don't know whether there is any setting in the middle block the traffic. Seems no way for me to find out which component is failed between.

Any suggestion is highly welcome, thanks in advance. // Jack


Solution

  • ssh tunneling solve the problem