-1

I'm trying to publish a Flask app in a Windows EC2 instance. When I run:

flask run --port 80 --host=0.0.0.0

It shows:

Running on http://<private_IP>/ (Press CTRL+C to quit)

If I try to access http://<private_IP>/ or http://<public_IP>/ from my local machine it doesn´t works.

I know that I'm ok with port permissions because if I run IIS and access http://<public_IP> it works, so I suppose that Flask decides to answer only <private_ip> requisitions.

Am I sure? How can I fix that?

Note: I tried the same in a Ubuntu EC2 instance and the problem remains exactly the same.

Mauro Assis
  • 375
  • 1
  • 5
  • 22

1 Answers1

-1

run it using a debug mode --debug that will show you wich addresses/ports are used for listening to requests.

Med Agou
  • 749
  • 4
  • If I run flask run --port 80 --host=0.0.0.0 --debugger (there's no --debug option) the only information about IP is the same: "Running on http://:80/ (Press CTRL+C to quit)". – Mauro Assis Dec 13 '22 at 00:02
  • If I try to access it from outside no additional information is shown. – Mauro Assis Dec 13 '22 at 00:18
  • can you check a telnet from your local machine on port 80. maybe you need to check the windows firewall as well. – Med Agou Dec 13 '22 at 00:29
  • As I explained above, there's no problem with the firewall or AWS security because IIS is answering my local machine when active on the server. – Mauro Assis Dec 13 '22 at 01:02
  • I created a new Linux Ubuntu EC2 instance and installed my flask app and the problem is the same: Flask shows the message: "Running on and I can´t access the app. – Mauro Assis Dec 13 '22 at 08:12
  • I changed to nginx and it's working now. – Mauro Assis Dec 13 '22 at 11:56