[uwsgi] socket = 127.0.0.1:8080 chdir = /usr/share/server wsgi-file = server.py callable = app processes = 4
###
location ~ ^/ {
include uwsgi_params;
uwsgi_pass 127.0.0.1:8080;
uwsgi_param UWSGI_PYTHON /usr/bin/python;
uwsgi_param UWSGI_CHDIR /usr/share/server;
uwsgi_param UWSGI_SCRIPT run:app;
}
### 将location块写入到nginx.conf的配置文件中,启动uwsgi服务和nginx服务即可,参考命令:uwsgi --ini uwsgi.ini
### 清除nginx注释 sed -ri.bak "/#|^$/d" nginx.conf,测试nginx配置文件nginx -t,停止nginx nginx -s stop,重启nginx nginx -s reload.
###