From 60558de72847f4af473028f11340c0a96f162da2 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Thu, 31 Oct 2024 18:04:55 +0100 Subject: [PATCH] proxy protocol: add more logs Signed-off-by: Nicola Murino --- internal/common/common.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/common/common.go b/internal/common/common.go index 6435c2af..0cbc0ec5 100644 --- a/internal/common/common.go +++ b/internal/common/common.go @@ -844,6 +844,7 @@ func getProxyPolicy(allowed, skipped []func(net.IP) bool, def proxyproto.Policy) if err != nil { // Something is wrong with the source IP, better reject the // connection. + logger.Error(logSender, "", "reject connection from ip %q, err: %v", connPolicyOptions.Upstream, err) return proxyproto.REJECT, proxyproto.ErrInvalidUpstream } @@ -863,6 +864,8 @@ func getProxyPolicy(allowed, skipped []func(net.IP) bool, def proxyproto.Policy) } if def == proxyproto.REQUIRE { + logger.Debug(logSender, "", "reject connection from ip %q: proxy protocol signature required and not set", + upstreamIP) return proxyproto.REJECT, proxyproto.ErrInvalidUpstream } return def, nil