美文网首页
nginx-uwsgi-django-mysql的docker部

nginx-uwsgi-django-mysql的docker部

作者: 王大吉 | 来源:发表于2018-06-22 15:23 被阅读0次

    uwsgi

    magellan.ini

    [uwsgi]
    http = :8090
    #socket = 172.18.0.2:8080
    chdir = /usr/local/magellan/magellan
    wsgi-file = magellan/wsgi.py
    processes = 4
    threads = 2
    master = true
    vacuum = true
    stats = 172.18.0.2:9191
    daemonize = /var/log/uwsgi/uwsgi.log
    

    运行 uwsgi magellan.ini 项目可访问 说明uwsgi运行成功

    nginx

    magellan.conf

    server{
        listen 8080;  # 监听访问8080端口
        # server_name 127.0.0.1;
        # server_name 61.48.40.126;
        # server_name 47.98.111.81;
        server_name _;  # 允许所有访问
        location / {
          proxy_pass http://127.0.0.1:8090;  
          proxy_set_header Host $http_host;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header X-Forwarded-Proto $scheme;
        }
        location /static {
          alias /usr/local/magellan/magellan/mystatic;  # 和django的STATIC_ROOT对上
        }
    }
    

    service nginx restart
    成功

    相关文章

      网友评论

          本文标题:nginx-uwsgi-django-mysql的docker部

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