diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2023-03-09 10:56:17 -0500 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2023-03-09 11:00:51 -0500 |
| commit | bab21cb7c4a469bcd0ac44df7d1170412eba6212 (patch) | |
| tree | 0b5254043d37257d34cc7906d890456b243a0824 /nginx | |
| parent | 2d595d44ca9278de213860e42ec46f2ae00ff6af (diff) | |
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.
Diffstat (limited to 'nginx')
| -rw-r--r-- | nginx/nginx.conf | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 24b138f3..454953ff 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -72,11 +72,12 @@ http { # maintained by certbot-ocsp-fetcher ssl_stapling_file ocsp-cache/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 ' '$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; + log_subrequest on; log_not_found off; gzip_proxied any; |
