美文网首页
nginx + uwsgi

nginx + uwsgi

作者: taojy123 | 来源:发表于2017-08-09 17:44 被阅读0次

    /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

          本文链接:https://www.haomeiwen.com/subject/hzyqrxtx.html