Nginx & uwsgi & Flask 部署

nginx.confg:

    server {
        listen 80; 
        server_name  uwsgi-flask;
        location / {

            include uwsgi_params;
            uwsgi_pass 127.0.0.1:5001;
            uwsgi_param UWSGI_CHDIR  /Users/wangjian/PythonWorkSpace/alformual/;
            uwsgi_param UWSGI_SCRIPT web:app; 
        }
    }

uwsgi.ini:

[uwsgi]
socket = 127.0.0.1:5001 # 同 nginx 配置
#application's base folder
pythonpath = (your project path)
wsgi-file = %(pythonpath)/main.py
callable= app
processes = 4
threads = 2
#location of log files
logto =/pathto/%n.log
pidfile = /pathto/uwsgi.pid

你可能感兴趣的:(Nginx & uwsgi & Flask 部署)