socket = 127.0.0.1:9000 之前这么写的总报502改后就没问题
[uwsgi]
socket = /tmp/uwsgi.sock
;将Flask应用运行在这个端口
master = true
wsgi-file = /zuhuobao/flaskobj/erp/server.py
chdir=/zuhuobao/flaskobj/erp
;后端文件名称
callable = app
;设置在收到请求时,uWSGI加载的模块中哪个变量将被调用,默认是名字为“application”的变量。即是: app = Flask(__name__)
processes = 4
threads = 2
daemonize = /zuhuobao/flaskobj/erp/logs/server.log
uid = www
gid = www
pidfile=uwsgi.pid
home=/zuhuobao/venv
server
{
listen 5000;
server_name 你的域名;
location / {
include uwsgi_params;
proxy_pass http://127.0.0.1:5001;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
uwsgi_pass unix:/tmp/uwsgi.sock;
}
access_log /zuhuobao/flaskobj/erp/logs/test.wechat.chexd.com.log;
error_log /zuhuobao/flaskobj/erp/logs/error_log.log;
}