nginx + uwsgi

/etc/nginx/sites-enabled/uwsgi.site :

server {
listen 8000;
server_name 127.0.0.1;
location /static/ {
  alias /root/SWE/static/;
  autoindex off;
}
location / {
  include uwsgi_params;
  uwsgi_pass 127.0.0.1:3031;
}
}
$nginx
$nginx -s reload
$service nginx restart

uwsgi.ini :

[uwsgi]
chdir=/root/SWE/
wsgi-file=/root/SWE/swegui/wsgi.py
master=True
socket=127.0.0.1:3031
processes=4
threads=2
daemonize=/var/log/uwsgi/swe.log
pidfile=/tmp/swe.pid
$uwsgi uwsgi.ini
$uwsgi --reload /tmp/swe.pid
$ps aux | grep uwsgi
$killall uwsgi

参考:
https://gist.github.com/taojy123/64b118fce5884da26d3d26fc42c6fedd
静态资源无法访问问题
http://ngcsnow.iteye.com/blog/2117975

你可能感兴趣的:(nginx + uwsgi)