我有一个使用
运行的应用程序client --> apache --> gunicorn --> wsgi --> django
当我运行我的代码时,它开始运行,然后我在apache日志中收到以下内容,
(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
代码中没有例外。但是,如果我运行没有gunicord / proxy层的代码,它就可以工作。这也仅影响了一些请求。
Heres是我的apache conf.d文件。
<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>