From 0bc8d1c6c3908d48608d3417c31d2a768832a627 Mon Sep 17 00:00:00 2001 From: scott sundahl Date: Wed, 7 Jan 2026 13:35:08 -0700 Subject: [PATCH] also log healthchecks for grafana alarms --- tools/reverse-proxy/nginx.conf | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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 {