配置app.ini


[uwsgi]
##执行运行用http,用nginx写socket,注意端口要和flask一致
#http=127.0.0.1:9200
socket=127.0.0.1:9200
chdir=/www/wwwroot/ugdemo
wsgi-file=app.py
callable=app
#指定工作进程
processes=2
#主进程
master=true
#指的后台启动 日志输出的地方
daemonize=/www/wwwroot/ugdemo/logs/uwsgi.log
#保存主进程的进程号
pidfile=/www/wwwroot/ugdemo/logs/uwsgi.pid


uwsgi --ini app.ini

uwsgi --stop /www/wwwroot/ugdemo/logs/uwsgi.pid
uwsgi --reload /www/wwwroot/ugdemo/logs/uwsgi.pid

nginx
server { 
    listen       80;
    server_name  www.rhihi.com;
    location / {
        include  uwsgi_params;
        uwsgi_pass  127.0.0.1:9200;
    }
    
    access_log  /www/wwwlogs/ugdemo.log;
    error_log  /www/wwwlogs/ugdemo.error.log;
}