I've got an Ubuntu server configured with Nginx and uWSGI to serve Django which was setup and working with the default start page yesterday.
All I have done since is install MySQL and later PostgreSQL and add Db settings to Django and now I get a 502 Gateway Error and the upstream prematurely closed connection while reading response header from upstream
error in my uwsgi error log.
I have had a look around and I've seen people suggest this can relate to a timeout setting and also that people have fixed it simply by reinstalling PHP, but I'd like to understand what exactly this means and hopefully how to fix it. Could someone possibly shed some light on this for me?
My uWSGI config looks like this;
# config
plugins = python
master = true
protocol = uwsgi
env = DJANGO_SETTINGS_MODULE=%(projectname).settings
pythonpath = %(base)/src/%(projectname)
module = %(projectname).wsgi
socket = 127.0.0.1:8889
logto = %(base)/logs/uwsgi.log
daemonize = /var/log/uwsgi/mydomain.log
And my Nginx config looks like this;
server {
listen 80;
server_name mydomain.com www.mydomain.com;
root /var/www/mydomain.com/src/wdsclients;
#access_log /var/www/mydomain.com/logs/access.log;
error_log /var/www/mydomain.com/logs/error.log;
server_tokens off;
location /startic/ { #STATIC_URL
alias /var/www/mydomain.com/src/static/; # STATIC_ROOT
expires 30d;
}
location /media/ { # MEDIA_URL
alias /var/www/mydomain.com/src/media/; # MEDIA_ROOT
expires 30d;
}
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:8889;
}
}