Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要在 access_log 中记录请求/响应大小(正文 + 标题)。知道如何在 nginx 中做到这一点吗?在 apache 中,我们可以使用 %I..%O 格式来做到这一点。
log_format combined '$request_length $bytes_sent';
根据文档,$request_length包括请求标头的长度,并且$bytes_sent是响应上述请求而发送给客户端的总字节数。
$request_length
$bytes_sent