How to log the Range header info in client requests to NGINX in Access Log

275 Views Asked by At

I want to log what is in the Range header in requests sent to Nginx, in Access Log if possible. How to do that?

1

There are 1 best solutions below

0
IVO GELOV On BEST ANSWER

You can use something like this

log_format myrange '$remote_addr [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_range"';

server {
    ...
    access_log /var/log/nginx/custom_range.log myrange;
}