Subject: [PATCH links] Correct IP extraction logic for api server.

From: Peter Sanchez <[email-masked]>
Date: Thu, 20 Mar 2025 12:56:42 -0600

Changelog-fixed: IP detection for api server under nginx reverse proxy.
Signed-off-by: Peter Sanchez <[email-masked]>
---
 cmd/api/main.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmd/api/main.go b/cmd/api/main.go
index c9f0a7b..5546df4 100644
--- a/cmd/api/main.go
+++ b/cmd/api/main.go
@@ -104,8 +104,8 @@ func run() error {
 
 	e := echo.New()
 	// https://echo.labstack.com/docs/ip-address
-	// Deployed via Caddy at the moment which uses X-Forwarded-For header by default
-	e.IPExtractor = echo.ExtractIPFromXFFHeader()
+	// nginx default instead of Caddy default.
+	e.IPExtractor = echo.ExtractIPFromRealIPHeader()
 
 	// email work queue and service, general task queue
 	eq := email.NewQueue(eSize)
-- 
2.47.2

---

From: "Peter Sanchez" <[email-masked]>
Date: Thu, 20 Mar 2025 13:03:14 -0600

Applied.

To [email-masked]:~netlandish/links
   536b6d2..b614e0a  master -> master