【发布时间】:2017-05-31 02:29:39
【问题描述】:
我正在尝试建立一个非常简单的 uWSGI + nginx 项目。 我遇到了以下问题
wsgi.input似乎是空的(我发现它试图得到 POST 变量)curl http://localhost:8080/parsings工作正常,但curl http://localhost:8080/parsings --header "Content-Length:1"挂起然后返回curl: (52) Empty reply from server- nginx
error.log上没有出现任何内容。 uWSGI 也不记录任何内容。看起来好像请求没有到达服务器附近的任何地方。
这里是配置
nginx.conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
proxy_buffers 8 32k;
proxy_buffer_size 64k;
proxy_connect_timeout 10;
proxy_send_timeout 15;
proxy_read_timeout 20;
}
sites-enabled/mysite
server {
listen 127.0.0.1:8080;
server_name myproject.local;
client_max_body_size 2M;
location / {
include uwsgi_params;
uwsgi_read_timeout 300;
uwsgi_pass unix:///tmp/my_project.sock;
}
}
uwsgi.ini
[uwsgi]
module = wsgi:application
master = true
processes = 5
static-map = /static/=/home/breln/projects/myproject/static
socket = /tmp/my_project.sock
chmod-socket = 777
chown-socket = www-data
vacuum = true
die-on-term = true
Nginx 是 1.11.8(1.10.2 出现了同样的问题)。 uWSGI 是 2.0.14
任何提示表示赞赏。
【问题讨论】:
标签: nginx uwsgi content-length