简体   繁体   中英

Python3 Sanic + ssl certificate

First of all, I am doing this for the first time and I know that I am lost.

I want to use Python Sanic as the Framework for my website. But I ALSO want to use my SSL certificate and my Domain. The method in the Sanic docs doesn't work. I search in the web and found that I need nginx or Apache2. But I have no idea what to do then.

It is probably best to use Nginx proxy for this. There should soon be a complete guide to this at https://sanic.readthedocs.io/en/latest/sanic/nginx.html (once docs are rebuilt, soon).

To enable built-in SSL support,

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",
))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM