Ubuntu下配置nginx和uWSGI

昨天开始配置nginx和uWSGI的组合,网上相关文章很多,但转来转去,越看越糊涂,感觉其实就是配置nginx,和php一样listen相应端口就是了。于是试着先配置nginx。直接修改网站配置文件中

location / {
uwsgi_pass 127.0.0.1:8000;
include uwsgi_params;
}

然后按照网上写运行 uWSGI的命令行:

/usr/local/bin/uwsgi –socket 127.0.0.1:8000 –module mysite.wsgi –chmod-socket=666,

开始可以运行,但提示无app可用,后来切换到mysite项目目录下,nginx可以访问了。然后将cd 及 uWSGI命令添加到rc.local中,重启后就可以访问了。

但这样有个问题就是如果修改了django的配置,似乎无法及时更新,这个需要进一步学习。

Leave a Reply

您的电子邮箱地址不会被公开。 必填项已用 * 标注

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>