在Nginx v.1.3.9 +中启用块传输编码

显然Nginx现在支持分块,但是当平板设备向Nginx发送分块请求时,我收到“411 Length Required”错误。 任何有关如何configurationNginx支持分块的build议? 我正在使用v.1.3.9。

我知道有一个类似的问题被问到 ,但是在2010年之前,Nginx支持chunked。

我的nginx.conf:

master_process off; worker_processes 1; daemon off; pid /usr/nginx/logs/nginx.pid; events { worker_connections 1024; } http { ngao_filters_directory /usr/nginx/filters; include mime.types; default_type application/octet-stream; # prevent caching by client add_header Cache-Control "no-store, no-cache"; sendfile on; keepalive_timeout 65; server { listen 8081; server_name localhost; client_max_body_size 3m; chunked_transfer_encoding on; scgi_temp_path /usr/nginx/scgi_temp; uwsgi_temp_path /usr/nginx/uwsgi_temp; location / { proxy_buffering off; proxy_pass http://10.0.2.20:79; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } } 

(发表回应,因为我还不能评论。需要> 50的声望)

你应该读这个 。

诀窍是proxy_buffering off; 在你的位置块。

^ —我看你已经试过了。

Nginx目前不支持分块的POST请求[…]
我发现唯一的工作解决scheme是这样的:
http://wiki.nginx.org/HttpChunkinModule

但是我认为这是你最好的select。 这意味着你需要编译nginx