yanksrock1000
yanksrock1000

Reputation: 421

Unable to access Flask app hosted on EC2 after adding https support

I have a Flask application currently using http being hosted on an ec2 instance. I want to host my application using https. Currently with http, I am able to access my application (running on 0.0.0.0 port 80) by just accessing the ec2 public IP address (displays Running on http://0.0.0.0:80/, and I am able to use my app at http://IP).

I am following this tutorial to test https support: https://blog.miguelgrinberg.com/post/running-your-flask-application-over-https.

When I add the most basic app.run(ssl_context='adhoc') to my program, the app is now Running on https://0.0.0.0:80/, but I am unable to access my app at https://IP. I opened up my port 403 in my EC2 settings however I am still unable to communicate with my app using https...no response whenever I make a request.

The same no response occurs when I run the application with gunicorn. Am I missing something? I think my requests are well formed, however I am never able to communicate with my app when using https.

Upvotes: 0

Views: 498

Answers (1)

Tuan Vo
Tuan Vo

Reputation: 2085

Simple way is put your instance behind ALB. ALB is not only load balancer, but also integrate ACM for free.

Upvotes: 1

Related Questions