Apache / Gunicorn and Django Issue

574 views Asked by At

I have an application that runs using

client --> apache --> gunicorn --> wsgi --> django

When I run my code it starts to run and then I receive the following within the apache logs,

(20014)Internal error: proxy: error reading status line from remote server 127.0.0.1
proxy: Error reading from remote server returned by /app/view

No exceptions show in the code. However if I run the code without the gunicord/proxy layer it works. Also this only affects some requests.

Heres is my apache conf.d file.

<VirtualHost 10.0.6.1:443>

        ServerName app.domain.net

        Alias /static /production/pythonenv/app/lib/python2.7/site-packages/rest_framework/static/
        ErrorLog /var/log/httpd/app-error.log
        CustomLog /var/log/httpd/app-access.log common

        LogLevel warn

        RewriteEngine On
        RewriteCond %{REQUEST_FILENAME}       !-f
        RewriteRule ^/(.*) http://127.0.0.1:9008/$1 [P]
        ProxyPassReverse / http://127.0.0.1:9008/

        SetEnv force-proxy-request-1.0 1 
        SetEnv proxy-nokeepalive 1
        RequestHeader unset Expect early

        ErrorLog logs/app-ssl-error.log
        CustomLog logs/app-ssl-access.log common
        SSLEngine on
        SSLCertificateFile /opt/ssl/crt/cert.crt
        SSLCertificateKeyFile /opt/ssl/crt/key.key
</VirtualHost>
0

There are 0 answers