From 6bee13bf9aba7639f9829bf2ea8b5ca72b1a270b Mon Sep 17 00:00:00 2001 From: "Gustavo \"Guz\" L de Mello" Date: Thu, 21 May 2026 16:59:12 -0300 Subject: [PATCH] fix(services,minecraft-servers): add real ip to reverse proxy headers --- services/minecraft-servers.nix | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/services/minecraft-servers.nix b/services/minecraft-servers.nix index 8d4c199..a3721bb 100644 --- a/services/minecraft-servers.nix +++ b/services/minecraft-servers.nix @@ -296,16 +296,22 @@ in { HTML 200 handle /git-pack-manager* { - reverse_proxy http://localhost:${toString meshLib.httpPort} + reverse_proxy http://localhost:${toString meshLib.httpPort} { + header_up X-Real-Ip {header.Cf-Connecting-Ip} + header_up X-Forwarded-For {header.Cf-Connecting-Ip} + header_up X-Forwarded-Proto https + header_up Host {host} + } } redir /map /map/ permanent handle_path /map/* { - reverse_proxy http://localhost:${toString bluemapServer.port} - } - - handle /* { - abort + reverse_proxy http://localhost:${toString bluemapServer.port} { + header_up X-Real-Ip {header.Cf-Connecting-Ip} + header_up X-Forwarded-For {header.Cf-Connecting-Ip} + header_up X-Forwarded-Proto https + header_up Host {host} + } } ''; };