Python3 Sanic + ssl 证书
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",
))
首先,我是第一次做这个,我知道我迷路了。
我想使用 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",
))