Home > Mobile >  ec2 web server on port 80 not reachable
ec2 web server on port 80 not reachable

Time:12-15

ec2 instance is not publically avaiable

I have a simple flask server open to port 80

there is even a public ip address but if I curl remotely to it connection get refused

curl result screenshot

but strangely ssh works just fine

and if I curl to public ip inside ec2 ssh it works

tried editing security group inboud rules but doesn't work...

googled bunch but all solutions say to edit inbound rules but it doesn't work for me...

am I doing something wrong?

inbound rule screenshot

thanks in advance

CodePudding user response:

The most common reason for this is that your Flask app is listening on localhost only, which is the default, and so is not reachable from outside the machine it's running on.

To fix this, make the server externally visible, by using:

app.run(host='0.0.0.0')
  • Related