uwsgi安装

  sre

安装

yum groupinstall -y "Development tools"
yum install -y zlib-devel bzip2-devel pcre-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel
pip install uwsgi
uwsgi --version

在/data/dev/api目录下配置,
vim //data/dev/api/uwsgi.ini

[uwsgi]
http=0.0.0.0:4999
wsgi-file=/data/dev/api/app.py
callable=app
touch-reload=/data/dev/api/

启动进程

nohup uwsgi --emperor /data/dev/api &>>/dev/null &

nginx配置:

location / {
        proxy_pass http://10.0.1.11:4999/;
        proxy_set_header X-Forwarded-For proxy_add_x_forwarded_for;
        setReal http_x_forwarded_for;
        if (Real ~ (\d+)\.(\d+)\.(\d+)\.(\d+),(.*) ){
                set Real1.2.3.4;
        }
        proxy_set_header X-Real-IpReal;
        proxy_redirect off;
        access_log /data/pwd_access.log;
        error_log /data/pwd_error.log;
}

One Reply to “uwsgi安装”

LEAVE A COMMENT

Captcha Code