nginx logs

This commit is contained in:
Zsolt Ero
2024-07-23 20:20:33 +02:00
parent d001c1e3a4
commit d19f3a45c0
5 changed files with 18 additions and 46 deletions

View File

@@ -43,6 +43,8 @@ http {
gzip_types application/json;
log_format access_json '{'
# general
'"time": "$time_iso8601", '
'"status": $status, '
'"request_method": "$request_method", '
@@ -50,16 +52,22 @@ http {
'"request": "$request", '
'"request_time": $request_time, '
'"body_bytes_sent": $body_bytes_sent, '
'"remote_addr": "$remote_addr", '
'"http_x_forwarded_for": "$http_x_forwarded_for", '
'"http_cf_connecting_ip": "$http_cf_connecting_ip", '
'"http_referrer": "$http_referer", '
'"http_user_agent": "$http_user_agent", '
'"scheme": "$scheme", '
'"host": "$host", '
'"http_host": "$http_host", '
'"http_cf_ray": "$http_cf_ray", '
'"http_cf_ipcountry": "$http_cf_ipcountry"'
# IP address related
#'"remote_addr": "$remote_addr", '
#'"http_x_forwarded_for": "$http_x_forwarded_for", '
# CF related
#'"http_cf_ray": "$http_cf_ray", '
#'"http_cf_ipcountry": "$http_cf_ipcountry", '
#'"http_cf_connecting_ip": "$http_cf_connecting_ip", '
'"_": "_"' # no trailing comma
'}';
# access log disabled by default