我在 Ubuntu 18.04 上通过 Gunicorn 运行 Flask 应用程序。 Gunicorn 在端口 80 上运行。我有 NGINX 设置,但它没有被使用并且被禁用。我能够成功地为 NGINX 设置 cert-bot,但它没有帮助,因为 NGINX 没有被使用,并且它也与端口 80 上的 gunicorn 冲突。是否可以获得专门用于 Gunicorn/Flask 的 SSL 证书或其他东西可以使用它吗? SSL 和 https
对页面至关重要。
最佳答案
您可以将 certbot 生成的 SSL 证书与 Gunicorn 一起使用:
gunicorn --keyfile /some/path/key.pem --certfile /some/path/cert.pem main:app
关于python-3.x - 如何为通过 Gunicorn 运行的 Flask 应用程序获取 SSL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62714873/