From f95a6b62a0acad326d623fc2e281134231930ad3 Mon Sep 17 00:00:00 2001 From: damencho Date: Tue, 3 Mar 2026 12:03:46 -0600 Subject: [PATCH] feat(web): Updates log formatter. --- web/rootfs/defaults/nginx.conf | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/web/rootfs/defaults/nginx.conf b/web/rootfs/defaults/nginx.conf index acfbbe5..fb93fcb 100644 --- a/web/rootfs/defaults/nginx.conf +++ b/web/rootfs/defaults/nginx.conf @@ -40,8 +40,23 @@ http { ## # Logging Settings ## + # Matches any URI or Referer with some matches and redacts the whole + # query string. log_format and map must be at the http context level. + map $request_uri $loggable_uri { + ~^(?P[^?]*)\?.*(?:jwt|token)= "${path}?[params_redacted]"; + default $request_uri; + } - access_log /dev/stdout; + map $http_referer $loggable_referer { + ~^(?P[^?]*)\?.*(?:jwt|token)= "${url}?[params_redacted]"; + default $http_referer; + } + + log_format jitsi_log '$remote_addr - $remote_user [$time_local] ' + '"$request_method $loggable_uri $server_protocol" ' + '$status $body_bytes_sent "$loggable_referer" "$http_user_agent"'; + + access_log /dev/stdout jitsi_log; error_log /dev/stderr; ##