# PUT support for chunked encoding with no Content-Length header

**URL:** <https://www.ruby-forum.com/t/put-support-for-chunked-encoding-with-no-content-length-header/187479>\
**Category:** NGINX\
**Created:** [April 23, 2010, 7:49pm UTC](https://www.ruby-forum.com/t/put-support-for-chunked-encoding-with-no-content-length-header/187479 "2010-04-23T19:49:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anichols](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ccd318/32.png) [@anichols](https://www.ruby-forum.com/u/anichols)\
**Post date:** [April 23, 2010, 7:49pm UTC](https://www.ruby-forum.com/t/put-support-for-chunked-encoding-with-no-content-length-header/187479/1 "2010-04-23T19:49:28Z")

</div>

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:

> **[PUT support for chunked encoding with no Content-Length header](https://forum.nginx.org/read.php?2,78526,78526#msg-78526)**
>
> 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...

---

<div class="post-metadata">

**Author:** ![anichols](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ccd318/32.png) [@anichols](https://www.ruby-forum.com/u/anichols)\
**Post date:** [April 25, 2010, 12:07pm UTC](https://www.ruby-forum.com/t/put-support-for-chunked-encoding-with-no-content-length-header/187479/2 "2010-04-25T12:07:13Z")

</div>

On Sat, Apr 24, 2010 at 1:48 AM, anichols [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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

---

<div class="post-metadata">

**Author:** ![anichols](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ccd318/32.png) [@anichols](https://www.ruby-forum.com/u/anichols)\
**Post date:** [April 25, 2010, 6:36pm UTC](https://www.ruby-forum.com/t/put-support-for-chunked-encoding-with-no-content-length-header/187479/3 "2010-04-25T18:36:27Z")

</div>

On Sun, Apr 25, 2010 at 4:06 AM, agentzh [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> You may find the ngx\_chunkin module helpful:
> 
> [GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](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

---

<div class="post-metadata">

**Author:** ![anichols](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ccd318/32.png) [@anichols](https://www.ruby-forum.com/u/anichols)\
**Post date:** [April 26, 2010, 5:14am UTC](https://www.ruby-forum.com/t/put-support-for-chunked-encoding-with-no-content-length-header/187479/4 "2010-04-26T05:14:58Z")

</div>

On Mon, Apr 26, 2010 at 12:35 AM, Aaron N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
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 🙂  
-agentzh

---

<div class="post-metadata">

**Author:** ![anichols](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ccd318/32.png) [@anichols](https://www.ruby-forum.com/u/anichols)\
**Post date:** [April 26, 2010, 4:04pm UTC](https://www.ruby-forum.com/t/put-support-for-chunked-encoding-with-no-content-length-header/187479/5 "2010-04-26T16:04:07Z")

</div>

On Sun, Apr 25, 2010 at 9:14 PM, agentzh [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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;
    }
}

```

}
