chunked_transfer_encoding seems doesn't work as expected

weiyuefei weiyuefei at gmail.com
Wed Nov 19 12:49:33 UTC 2014


Hi All,

When i try to use the directive "chunked_transfer_encoding" to control the encoding type of output data, it failed to output the chunked data even thougth i turned on the directive as "chunked_transfer_encoding on;".

Here is the simple example of my config==>
location /chunked {
        root   /;
        chunked_transfer_encoding on;
        return 200 "hello\n";
}


location /unchunked {
        root /;
        chunked_transfer_encoding off;
        return 200 "world\n";
}

And here is the results of the test bu curl.

curl -i "localhost:8345/chunked"

HTTP/1.1 200 OK
Server: nginx/1.7.7
Date: Wed, 19 Nov 2014 02:26:14 GMT
Content-Type: application/octet-stream
Content-Length: 6
Connection: keep-alive


hello


curl -i "localhost:8345/unchunked"


HTTP/1.1 200 OK
Server: nginx/1.7.7
Date: Wed, 19 Nov 2014 02:26:59 GMT
Content-Type: application/octet-stream
Content-Length: 6
Connection: keep-alive


world

======================
i am expecting that chunked data will be obtained when the request goes into the chunked location, however, the directive seems doesn't work as expected.


We are using nginx as web server, so could anyone explain that and suggest solution to resolve this issue?

Best regards,

2014-11-19



weiyuefei
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20141119/e6f4e733/attachment.html>


More information about the nginx mailing list