improve HTTP request logging

* add $upstream_cache_status
* add '-$connection_requests' after $connection
* enable subrequest logging

$connection_requests makes it much easier to see connection reuse in the
logs and also helps to understand subrequests.
This commit is contained in:
Daniel Micay 2023-03-09 10:54:28 -05:00
parent 937be19e46
commit 32a33ba94f

View File

@ -72,11 +72,12 @@ http {
# maintained by certbot-ocsp-fetcher # maintained by certbot-ocsp-fetcher
ssl_stapling_file ocsp-cache/matrix.grapheneos.org.der; ssl_stapling_file ocsp-cache/matrix.grapheneos.org.der;
log_format main '$connection $remote_addr $remote_user $ssl_protocol $server_protocol ' log_format main '$connection-$connection_requests $remote_addr $remote_user $ssl_protocol $server_protocol '
'$host $request_method "$request_uri" $status $request_length $body_bytes_sent/$bytes_sent ' '$host $request_method "$request_uri" $status $request_length $body_bytes_sent/$bytes_sent '
'$request_time $upstream_connect_time/$upstream_header_time/$upstream_response_time ' '$request_time $upstream_connect_time/$upstream_header_time/$upstream_response_time '
'"$http_referer" "$http_user_agent"'; '$upstream_cache_status "$http_referer" "$http_user_agent"';
access_log syslog:server=unix:/dev/log,nohostname main; access_log syslog:server=unix:/dev/log,nohostname main;
log_subrequest on;
log_not_found off; log_not_found off;
gzip_proxied any; gzip_proxied any;