[Answer]-502 Bad Gateway connecting Nginx to django via socket

1👍

You put it in your uwsgi ini file. Here is an example one:

 [uwsgi]
 # Django-related settings
 # the base directory (full path)
 chdir           = /var/www/virtualenv/project
 # Django's wsgi file
 module          = uwsgi
 # the virtualenv (full path)
 home            = /var/www/virtualenv/
 wsgi-file       = /var/www/virtualenv/project/projectsettings/wsgi.py
 # process-related settings
 # master
 master          = true
 # maximum number of worker processes
 processes       = 10
 # the socket (use the full path to be safe
 socket          = /tmp/mysite.sock
 # ... with appropriate permissions - may be needed
 chmod-socket    = 664 
 # clear environment on exit
 vacuum          = true

This is my ini file minus my path’s to my projects. I also ran into this same issue when installing it myself but was able find the appropriate answer from looking at other configs on google.

Leave a comment