Hello, I do use nginx + uwsgi + postgres. Maybe you could try one of 
following points below ?
Cheers.
1) there is a very good tutorial to install nginx, see below. This is the 
one I used for step by step installation on production server :
http://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html

2) on top of my head, I had error " upstream prematurely closed connection 
while reading response header from upstream" one or two times several 
months ago, while installing production server. This was due to an 
incorrect setting in nginx configuration file 'mysite_nginx.conf'. I do not 
remember exactly which setting, sorry (are you running http or https ?).

3) you could check that your postgresql server is up and running (I do this 
with webmin http://www.webmin.com/ ).

4) you could try to install first nginx using 'TCP port socket' (and not 
'Unix socket') for test purpose. This is explained in tutorial above.

5) you could look at nginx error log in /var/log/nginx directory

6) error could be due to incorrect permissions. So maybe you should set 
permissions as below (this is explained in tutorial) :
uwsgi --socket site.sock --wsgi-file test.py --chmod-socket=666

7) you could add settting below in django settings.py in order to receive 
description of error by mail

ADMINS = (

('ME', ‘j...@gmail.com'),

)



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b1c78398-109e-4764-aebe-250c6f511e74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to