Gunicorn ‘Green Unicorn’ is a Python WSGI HTTP Server for UNIX.

官网:​​https://gunicorn.org/​

安装:

pip install gunicorn
#或者
sudo apt install

基本使用:

  • 启动一个flask的项目:
# myapp py文件
# app 启动
gunicorn -w 4 myapp:app

绑定IP,PORT

gunicorn -w 4 test:app -b 192.168.1.51:8080

守护进程启动

gunicorn -w 4 myapp:app --daemon

nginx做代理转发