fix(router): trust all proxies to fix MCP 'invalid Host header' error
Build and Deploy / build-and-push (push) Successful in 53s
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:
@@ -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())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user