[英]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.