title: uwsgi ini file configuration
body: <p>I have a Python application running on a server. I am trying to configure uwsgi server in my application.</p>
  <p>uwsgi.conf file location : /etc/init/uwsgi.conf</p>
  <pre><code># file: /etc/init/uwsgi.conf
  description &quot;uWSGI starter&quot;
  
  start on (local-filesystems and runlevel [2345])
  stop on runlevel [016]
  
  respawn
  
  # home - is the path to our virtualenv directory
  # pythonpath - the path to our django application
  # module - the wsgi handler python script
  
  exec /home/testuser/virtual_environments/django-new/bin/uwsgi \
  --uid root \
  --home /home/testuser/virtual_environments/django-new \
  --pythonpath /home/testuser/django \
  --socket /tmp/uwsgi.sock \
  --chmod-socket \
  --module wsgi \
  --logdate \
  --optimize 2 \
  --processes 2 \
  --master \
  --logto /var/log/uwsgi.log
  </code></pre>
  <p>and I have created this .ini file:</p>
  <p>/etc/uwsgi/app-available/uwsgi.ini</p>
  <pre><code>[uwsgi]
  home = /home/testuser/virtual_environments/django-new
  pythonpath = /home/testuser/django
  socket = /tmp/uwsgi1.sock
  module = wsgi
  optimize = 2 
  processes = 2
  </code></pre>
  <p>nginx configuration:</p>
  <p>/etc/nginx/site-available/default</p>
  <pre><code>upstream uwsgicluster {
      #server unix:/tmp/uwsgi.sock;
      server unix:///tmp/uwsgi1.sock;
  }
  server {
          location / {
                  uwsgi_pass   uwsgicluster;
          #uwsgi_pass unix:/run/uwsgi/app/scisphere/socket;
          #proxy_pass  http://uwsgicluster;
                  include /etc/nginx/uwsgi_params;
          }
  
          location /static {
                   root /home/testuser/django/main;
          }
          location /media {
                   root /home/testuser/django;
          }
  }
  </code></pre>
  <p>I try to start the server:</p>
  <pre><code>sudo service uwsgi start
  </code></pre>
  <p>I am getting 502 Bad Gateway error. How to configure uwsgi.ini file in uwsgi.conf?</p>