Opened 6 years ago

Closed 6 years ago

#1596 closed defect (duplicate)

$body_bytes_sent larger than acutual body size when chunked enabled

Reported by: wangke1020@… Owned by:
Priority: minor Milestone:
Component: other Version: 1.10.x
Keywords: body_bytes_sent Cc:
uname -a: Linux 3.19.0-25-generic #26~14.04.1-Ubuntu SMP x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.10.2
built by gcc 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
built with OpenSSL 1.0.2j 26 Sep 2016
TLS SNI support enabled


Recently we found that $body_bytes_sent in Nginx log is larger than acutual body size in some case. After checking these request and comparing between size of downloaded file and size of upstream server response, it seems $body_bytes_sent is not correct when gzip or chunked enabled. For example, actual dowloaded file size is 71904 while $body_bytes_sent is 72051 and $bytes_sent is 72883.

Is it a bug? Does Nginx counts some extra bytes like CRLF when response in chunks?

Change History (1)

comment:1 by Maxim Dounin, 6 years ago

Resolution: duplicate
Status: newclosed

That's expected, see #997.

Note: See TracTickets for help on using tickets.