【问题标题】:Python3 Sanic + ssl certificatePython3 Sanic + ssl 证书
【发布时间】:2020-07-09 11:45:16
【问题描述】:

首先,我是第一次这样做,我知道我迷路了。

我想使用 Python Sanic 作为我网站的框架。但我也想使用我的 SSL 证书和我的域。 Sanic 文档中的方法不起作用。我在网上搜索,发现我需要 nginx 或 Apache2。但我不知道该怎么办。

【问题讨论】:

    标签: python-3.x apache nginx webserver sanic


    【解决方案1】:

    为此最好使用 Nginx 代理。 https://sanic.readthedocs.io/en/latest/sanic/nginx.html 应该很快就会有一个完整的指南(一旦重建文档,很快)。

    要启用内置 SSL 支持,

    app.run(host="0.0.0.0", port=443, ssl=dict(
        cert="/etc/letsencrypt/live/example.com/fullchain.pem",
        key="/etc/letsencrypt/live/example.com/privkey.pem",
    ))
    

    【讨论】:

    • 页面大概什么时候可用?
    • 20.3 版本应该会在今天发布,但我还没有从版本经理那里听到任何消息。据推测,如果不是今天,那么至少在几天内就会发生文档重建。
    • 看起来发布可能会延迟,但可以在github.com/huge-success/sanic/blob/master/docs/sanic/nginx.rst阅读当前文档
    猜你喜欢
    • 2018-03-03
    • 2016-10-08
    • 1970-01-01
    • 1970-01-01
    • 2018-08-23
    • 2017-06-13
    • 2019-03-29
    • 2014-01-05
    相关资源
    最近更新 更多