title: Python Django+Nginx+uwsgi 502 Bad Gateway
body: <p>Centos7,when I connect to my website, shows 502 Bad Gateway,<br>
  I test my website with command<br>
  uwsgi --ini<br>
  systemctl start nginx<br>
  And I cant figure out what's happened,please help me!</p>
  
  <p>here's nginx.conf</p>
  
  <pre><code>upstream django {
    server 127.0.0.1:8000;
  }
  
  server {
      listen       80 default_server;
      listen       [::]:80 default_server;
      server_name  example.com;
      charset      utf-8;
  
      include /etc/nginx/default.d/*.conf;
  
      location / {
        include uwsgi_params;
        uwsgi_pass django;
      }
  
      location /static/ {
        alias /usr/local/etc/dmp/static/;
      }
  }
  </code></pre>
  
  <p>and uwsgi setting </p>
  
  <pre><code>[uwsgi]
  
  chdir = /usr/local/etc/dmp
  
  module = DMP_python.wsgi
  
  plugins = python3
  
  socket = :8000
  
  chmod-socket = 666
  
  master = true
  
  processes = 2
  
  vacuum = true
  </code></pre>