且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在https上运行gunicorn?

更新时间:2022-12-07 12:28:58

Gunicorn现在支持SSL,从版本17.0开始。您可以将其配置为像这样监听https:

Gunicorn now supports SSL, as of version 17.0. You can configure it to listen on https like this:

$ gunicorn --certfile=server.crt --keyfile=server.key test:app

如果您使用 - bind 要侦听端口80,请记住将端口更改为443(HTTPS连接的默认端口)。例如:

If you were using --bind to listen on port 80, remember to change the port to 443 (the default port for HTTPS connections). For example:

$ gunicorn --certfile=server.crt --keyfile=server.key --bind 0.0.0.0:443 test:app