PUT support for chunked encoding with no Content-Length header

Hello,
I have seen this topic discussed here but never with any conclusion
that I saw. I am trying to move to nginx in an environment where we PUT
files using chunked encoding. We do not provide the Content-Length
because we do not have this information, files we are storing could be
very large and are effectively streamed into our application and then
into nginx (which we are trying to use with mogilefs).

The error I am getting in the nginx logs when I try to do this is the
following:

2010/04/22 13:03:41 663#0: *257 client sent PUT method without
“Content-Length” header while reading client request headers, client:
127.0.0.1, server: localhost, request: “PUT
/dev4/0/000/026/0000026938.fid HTTP/1.1”, host: “127.0.0.1:7500”

I have tested this on both nginx version 0.7.65 & 0.8.36. I have also
tried incorporating the chunkin module with no success. Is this known to
work and perhaps I have a configuration issue or is this a known
limitation / bug?

Happy to post my config if it’s helpful, but wanted to start by just
asking if this should work.

Thank you,
Aaron

Posted at Nginx Forum:

On Sat, Apr 24, 2010 at 1:48 AM, anichols [email protected] wrote:

Hello,
I have seen this topic discussed here but never with any conclusion that I saw. I am trying to move to nginx in an environment where we PUT files using chunked encoding. We do not provide the Content-Length because we do not have this information, files we are storing could be very large and are effectively streamed into our application and then into nginx (which we are trying to use with mogilefs).

The error I am getting in the nginx logs when I try to do this is the following:

You may find the ngx_chunkin module helpful:

http://wiki.nginx.org/NginxHttpChunkinModule

Cheers,
-agentzh

On Sun, Apr 25, 2010 at 4:06 AM, agentzh [email protected] wrote:

You may find the ngx_chunkin module helpful:

http://wiki.nginx.org/NginxHttpChunkinModule

Yep, I tried this module right off the bat and received the same
error. Do you know if that module supports chunked encoding without
providing the Conten-Length header? If so, perhaps there was a
misconfiguration. Would love to work with someone who has this working
to sort out what I may have done wrong.

Thanks,
Aaron

On Mon, Apr 26, 2010 at 12:35 AM, Aaron N. [email protected]
wrote:

Yep, I tried this module right off the bat and received the same
error. Do you know if that module supports chunked encoding without
providing the Conten-Length header? If so, perhaps there was a
misconfiguration. Would love to work with someone who has this working
to sort out what I may have done wrong.

Could you please paste out your configuration?

Thanks :slight_smile:
-agentzh

On Sun, Apr 25, 2010 at 9:14 PM, agentzh [email protected] wrote:

Could you please paste out your configuration?

Yes - I’ve tried a few variations but here’s the last one w/ chunkin
module enabled:

worker_processes 1;
error_log /var/log/nginx/error.log info;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

sendfile        on;

server {
    listen       7500;
    server_name  localhost;

    chunkin on;

    error_page 411 = @my_411_error;
    location @my_411_error {
        chunkin_resume;
    }

    location / {
        root   /var/mogdata;
        expires max;
        client_max_body_size 20m;
        dav_methods put delete mkcol copy move;
        dav_access user:rw group:rw all:r;
        create_full_put_path on;
        autoindex on;
        index  index.html index.htm;
    }

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }
}

}