我正在运行一段非常简单的python代码,它在OpenBSD下运行完美(使用httpd + uwsgi)。具有相同uwsgi配置的相同代码根本不在Linux下运行(使用nginx)。
代码为here,uwsgi.ini
文件为here以及以下内容:
[uwsgi]
fastcgi-socket = 127.0.0.1:3031
uid = uwsgi
module = url_share
callable = parent_app
virtualenv = %d/venv
chdir = %d
# daemonize after loading app
daemonize2 = True
我假设问题出现在nginx中,这是我唯一能够控制的变化变量。它的配置也非常简单:
server {
location /urlsh/ {
include uwsgi_params;
uwsgi_pass 127.0.0.1:3031;
}
特别是,nginx的error_log是:
2015/11/30 23:03:32 [error] 27894#0: *1 upstream prematurely closed connection while reading response header from upstream, client: 192.168.1.107, server: , request: "GET /urlsh/ HTTP/1.1", upstream: "uwsgi://127.0.0.1:3031", host: "192.168.1.10"
使用网络浏览器打开页面后,这种情况恰好 8.1秒:
$ time curl 127.0.0.1/urlsh/
<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.2.1</center>
</body>
</html>
real 0m8.120s
user 0m0.060s
sys 0m0.020s
我的问题是:如何让uwsgi打印更多输出?
我试图查明问题的事情:
print
语句:它们被打印,因此应用程序运行系统是Linux Raspbian 7.8&#34; Wheezy&#34;。 Python是2.7.3,uwsgi(通过pip安装)是2.0.11.2。