uwsgi nginx 配置文件内容

2018/10 15 15:10

存放在任意位置使用时候 uwsgi  --ini  uwsgi.ini

-------uwsgi.ini-----

[uwsgi]
chdir=/flaskweb/
home=/flaskweb/envf
module=hello
callable=app
master=true
processes=2
socket=/flaskweb/uwsgi.sock
chmod-socket=666
logfile-chmod=644
daemonize=%(chdir)/uwsgi.log
stats=%(chdir)/uwsgi.status
pidfile=%(chdir)/uwsgi.pid
procname-prefix-spaced=mysite

 

 

module:加载指定的python WSGI模块

callable:在收到请求时,uWSGI加载的模块中哪个变量将被调用,默认是名字为“application”的变量.也是create_app的实例


---nginx           存放位置 /etc/nginx/conf.d/web.com.cc.conf


---------web.com.cc.conf--------

server{
listen 80;
server_name web.com.cc;
charset utf-8;
location /{
include uwsgi_params;
uwsgi_pass unix://flaskweb/uwsgi.sock;
uwsgi_param UWSGI_PYHOME /flaskweb/envf;
uwsgi_param UWSGI_CHDIR /flaskweb;
uwsgi_param UWSGI_SCRIPT run:app;
}
location /static{
alias /flaskweb/static;
}
}

 

--转载请注明: http://91o.cc/uwsgi-nginx-%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6%e5%86%85%e5%ae%b9/

发表回复

(必填)