nginx-uwsgi-django-mysql的docker部

2018-06-22  本文已影响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
成功

上一篇下一篇

猜你喜欢

热点阅读