From bc001033ec4cc6d97000121240afb1b8c94723e4 Mon Sep 17 00:00:00 2001 From: Francesco Pantano Date: Mon, 29 Jun 2026 16:07:54 +0200 Subject: [PATCH] Fix client IP logging in Horizon VirtualHost The VirtualHost CustomLog directive was using a custom format that only logged forwarded requests, missing direct requests entirely. Replace with SetEnvIf and dual CustomLog lines to match the nova-operator pattern, logging both direct and forwarded requests with the correct client IP. Closes: OSPRH-32110 Co-Authored-By: Claude Opus 4.6 Signed-off-by: Francesco Pantano --- templates/horizon/config/httpd.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/horizon/config/httpd.conf b/templates/horizon/config/httpd.conf index 2370eb71..82d59822 100644 --- a/templates/horizon/config/httpd.conf +++ b/templates/horizon/config/httpd.conf @@ -51,7 +51,9 @@ LogLevel debug ## Logging ErrorLog {{ .LogFile }} ServerSignature Off - CustomLog {{ .LogFile }} "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" env=forwarded + SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded + CustomLog {{ .LogFile }} combined env=!forwarded + CustomLog {{ .LogFile }} proxy env=forwarded ## RedirectMatch rules RedirectMatch permanent ^/$ "{{ .horizonEndpoint }}/dashboard"