Python3 Sanic + ssl certificate



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

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

最好使用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",
))

相关内容

最新更新