From 7a0b6f4c7dc4c5353c5109715cbe7f20bd59a3fe Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 31 Jan 2024 11:34:34 +0800 Subject: [PATCH] :bug: Fix couldn't get ip behind reverse proxy --- pkg/server/startup.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/server/startup.go b/pkg/server/startup.go index 2593a9b..972c9d2 100644 --- a/pkg/server/startup.go +++ b/pkg/server/startup.go @@ -24,6 +24,7 @@ func NewServer() { EnableIPValidation: true, ServerHeader: "passport", AppName: "passport", + ProxyHeader: fiber.HeaderXForwardedFor, JSONEncoder: jsoniter.ConfigCompatibleWithStandardLibrary.Marshal, JSONDecoder: jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal, EnablePrintRoutes: viper.GetBool("debug"),