fix(router): trust all proxies to fix MCP 'invalid Host header' error
Build and Deploy / build-and-push (push) Successful in 53s

- Set TrustedProxies to nil to allow reverse proxy requests
- Add explicit routes for /mcp without trailing slash
This commit is contained in:
2026-07-27 03:10:24 +08:00
parent 2c9b44aeca
commit 19b3fb60f7
2 changed files with 14 additions and 0 deletions
+5
View File
@@ -43,6 +43,11 @@ func Setup(c *Controllers) *gin.Engine {
gin.SetMode(gin.ReleaseMode)
}
router := gin.New()
// 信任所有反向代理(Docker/Nginx 场景)
// 设置为 nil 表示信任所有,避免 "invalid Host header" 错误
router.SetTrustedProxies(nil)
router.Use(middleware.GinLogger(), middleware.GinRecovery())
router.Use(middleware.TravelProxyMiddleware())