Logging Request/Response size in access_log of Nginx

6.6k Views Asked by At

I need to log request/response size(body+headers) in the access_log. Any idea how to do it in nginx? In apache we can do it using %I..%O format.

1

There are 1 best solutions below

0
On BEST ANSWER
log_format combined '$request_length $bytes_sent';

According to docs $request_length includes the length of request headers and $bytes_sent is a total bytes sent to the client in response to the mentioned request.