B
B
Boldy2015-01-30 20:19:35
Django
Boldy, 2015-01-30 20:19:35

Why does apache return 500 and nginx+gunicorn return 502 when trying to open some urls?

There is a django app running under apache mod_wsgi. When trying to access one of the urls, it gives an Internal Server Error, and the following is displayed in the error.log:

[Fri Jan 30 12:07:01.165671 2015] [mpm_event:notice] [pid 24392:tid 139661571377024] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 configu$
[Fri Jan 30 12:07:01.165800 2015] [core:notice] [pid 24392:tid 139661571377024] AH00094: Command line: '/usr/sbin/apache2'
[Fri Jan 30 12:09:39.127704 2015] [core:error] [pid 24397:tid 139661297006336] [client 31.192.249.250:22058] End of script output before headers: wsgi.py, referer: http://purepro.kg/accounts/profile/awards_report/

When using gunicorn+nginx:
2015/02/03 04:39:04 [error] 2599#0: *25 upstream prematurely closed connection while reading response header from upstream, client: 212.42.126.225, server: _, request: "GET /pyramid/profile/awards_report/?date_min=2015-02-05&date_max=2015-02-06 HTTP/1.1", upstream: "http://127.0.0.1:9000/pyramid/profile/awards_report/?date_min=2015-02-05&date_max=2015-02-06", host: "purepro.kg", referrer: "http://purepro.kg/pyramid/profile/awards_report/"

wsgi.py:
import os
from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings")
application = get_wsgi_application()

configs:
WSGIDaemonProcess pureproonline python-path=/var/www/proj/app/:/var/www/proj/lib/python2.7/site-packages/
WSGIProcessGroup pureproonline
WSGIScriptAlias / /var/www/proj/app/main/wsgi.py
Alias /static/ /var/www/proj/app/main/static/

What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question