繁体   English   中英

添加 https 支持后,无法访问托管在 EC2 上的 Flask 应用程序

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

我有一个 Flask 应用程序,当前使用 http 托管在 ec2 实例上。 我想使用 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应用程序在http://IP )。

我正在按照本教程测试 https 支持: https://blog.miguelgrinberg.com/post/running-your-flask-application-over-https

当我将最基本的app.run(ssl_context='adhoc')添加到我的程序中时,该应用程序现在Running on https://0.0.0.0:80/ ,但我无法在https://上访问我的应用程序知识产权 我在我的 EC2 设置中打开了端口 403,但是我仍然无法使用 https 与我的应用程序通信......每当我提出请求时都没有响应。

当我使用 gunicorn 运行应用程序时,同样没有响应。 我错过了什么吗? 我认为我的请求格式正确,但是在使用 https 时,我永远无法与我的应用程序通信。

简单的方法是将您的实例放在 ALB 后面。 ALB 不仅是负载均衡器,还免费集成 ACM。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM