6

Apparently Nginx now supports Chunked, but I receive error "411 Length Required" when a tablet device sends a Chunked request to Nginx. Any advice as to how to configure Nginx to support Chunked? I'm using v.1.3.9.

I know a similar question was asked, but it was in 2010 before chunked was supported in Nginx.

My 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;
        } } }
Meir
  • 171
  • 1
  • 6
  • Probably a dupe http://serverfault.com/questions/159313/enabling-nginx-chunked-transfer-encoding/187573#187573 – Danack May 12 '13 at 16:03
  • 5
    No, this is _not_ a dupe. This question deals with chunked _requests_ while the other deals with chunked _responses_. – Michael Hampton May 12 '13 at 22:00
  • 1
    Ah not a dupe at all. According to this http://www.ruby-forum.com/topic/4408411 no configuration is required 'There are no special directives at all. It just works.'. If it's not working from a tablet, how about testing with CURL 'curl -v -X POST --header "Transfer-Encoding: chunked" -d @Test.txt "http://localhost:8080/"' ? – Danack May 13 '13 at 22:17

1 Answers1

3

(Posting a response because I cannot comment yet. Need >50 reputation)

You should read this.

The trick is to set proxy_buffering off; in your location block.

^--- I see you have already tried this.

Nginx does not currently support chunked POST requests [...]
The only working solution I found is this:
http://wiki.nginx.org/HttpChunkinModule

^--- But I think this is your best bet. It implies that you need to compile nginx, though

moebius_eye
  • 1,092
  • 7
  • 21