$body_bytes_sent larger than acutual body size when chunked enabled
|Reported by:||Owned by:|
|uname -a:||Linux 3.19.0-25-generic #26~14.04.1-Ubuntu SMP x86_64 GNU/Linux|
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?