diff options
| author | 2026-06-24 02:09:52 -0600 | |
|---|---|---|
| committer | 2026-06-24 02:09:52 -0600 | |
| commit | cf1e3ec5a76ab1295a45b99b0165ba7fdb9c2585 (patch) | |
| tree | 14a5d980a2798b81045fcc401ab43684b2f2482e | |
| parent | add trusted cert file too (diff) | |
json logs
| -rw-r--r-- | nginx.conf | 42 | ||||
| -rw-r--r-- | server.conf | 2 |
2 files changed, 43 insertions, 1 deletions
@@ -26,6 +26,48 @@ http { '"$http_referer" "$http_user_agent" ' '"$gzip_ratio" ' '"$http_host" "$http_x_i2p_destb32" "$http_x_i2p_desthash" "$http_x_i2p_destb64"'; + log_format json escape=json '{' + '"epoch":"$msec",' # request unixtime in seconds with a milliseconds resolution + '"connection":"$connection",' # connection serial number + '"connection_requests":"$connection_requests",' # number of requests made in connection + '"pid":"$pid",' # process pid + '"request_id":"$request_id",' # the unique request id + '"request_length":"$request_length",' # request length (including headers and body) + '"remote_addr":"$remote_addr",' # client IP + '"remote_user":"$remote_user",' # client HTTP username + '"remote_port":"$remote_port",' # client port + '"time_local":"$time_local",' + '"time_iso8601":"$time_iso8601",' # local time in the ISO 8601 standard format + '"request":"$request",' # full path no arguments if the request + '"request_uri":"$request_uri",' # full path and arguments if the request + '"args":"$args",' # args + '"status":"$status",' # response status code + '"body_bytes_sent":"$body_bytes_sent",' # the number of body bytes exclude headers sent to a client + '"bytes_sent":"$bytes_sent",' # the number of bytes sent to a client + '"http_referer":"$http_referer",' # HTTP referer + '"http_user_agent":"$http_user_agent",' # user agent + '"http_x_forwarded_for":"$http_x_forwarded_for",' # http_x_forwarded_for + '"http_host":"$http_host",' # the request Host: header + '"http_sec_ch_ua_platform":"$http_sec_ch_ua_platform",' + '"http_sec_ch_ua":"$http_sec_ch_ua",' + '"server_name":"$server_name",' # the name of the vhost serving the request + '"request_time":"$request_time",' # request processing time in seconds with msec resolution + '"upstream":"$upstream_addr",' # upstream backend server for proxied requests + '"upstream_connect_time":"$upstream_connect_time",' # upstream handshake time incl. TLS + '"upstream_header_time":"$upstream_header_time",' # time spent receiving upstream headers + '"upstream_response_time":"$upstream_response_time",' # time spend receiving upstream body + '"upstream_response_length":"$upstream_response_length",' # upstream response length + '"upstream_cache_status":"$upstream_cache_status",' # cache HIT/MISS where applicable + '"ssl_protocol":"$ssl_protocol",' # TLS protocol + '"ssl_cipher":"$ssl_cipher",' # TLS cipher + '"scheme":"$scheme",' # http or https + '"request_method":"$request_method",' # request method + '"server_protocol":"$server_protocol",' # request protocol, like HTTP/1.1 or HTTP/2.0 + '"pipe":"$pipe",' # āpā if request was pipelined, ā.ā otherwise + '"gzip_ratio":"$gzip_ratio",' # gzip ratio + '"http_accept":"$http_accept"' # accept header + '}'; + client_header_timeout 10m; client_body_timeout 10m; diff --git a/server.conf b/server.conf index 4d3a710..6b6fc02 100644 --- a/server.conf +++ b/server.conf @@ -1,5 +1,5 @@ http2 on; -access_log /var/log/nginx/access.log i2pd; +access_log /var/log/nginx/access.log.json json; location /.well-known/ { root /var/www/localhost/htdocs; |
