diff --git a/tools/reverse-proxy/nginx.conf b/tools/reverse-proxy/nginx.conf index 2304efc..dd7420a 100644 --- a/tools/reverse-proxy/nginx.conf +++ b/tools/reverse-proxy/nginx.conf @@ -12,8 +12,16 @@ http { include /etc/nginx/mime.types; default_type application/octet-stream; - # Log format - includes IP, timestamp, method, URL, status, referrer - log_format main '$remote_addr [$time_local] $request_method "$request_uri" $status "$http_referer"'; + # Map status to result label + map $status $result { + ~^[23] "success"; + ~^4 "client_error"; + ~^5 "server_error"; + default "unknown"; + } + + # Log format - includes IP, timestamp, method, URL, status, result, referrer + log_format main '$remote_addr [$time_local] $request_method "$request_uri" $status $result "$http_referer"'; # Map to identify errors (4xx/5xx) map $status $is_error {