From c35d90e94f2abeb5d84fb5236e6d3cbe969cd8c4 Mon Sep 17 00:00:00 2001 From: hailin Date: Sun, 11 Jan 2026 17:52:53 -0800 Subject: [PATCH] =?UTF-8?q?fix(kong):=20=E4=BF=AE=E5=A4=8Dauth-service?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将service URL从 /api/v2 改为根路径 - 设置 strip_path: false 直接透传请求路径 - 保持前后端路径一致: /api/v2/auth/... 问题原因: strip_path: true 会移除 /api/v2/auth, 导致后端收到 /api/v2/login 而不是 /api/v2/auth/login Co-Authored-By: Claude Opus 4.5 --- backend/api-gateway/kong.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/api-gateway/kong.yml b/backend/api-gateway/kong.yml index c6e09cca..ea29006c 100644 --- a/backend/api-gateway/kong.yml +++ b/backend/api-gateway/kong.yml @@ -339,19 +339,20 @@ services: # --------------------------------------------------------------------------- # Auth Service 2.0 - 用户认证服务 - # 服务全局前缀: /api/v2, 所以需要strip_path后添加前缀 + # 前端路径: /api/v2/auth/... + # 后端路径: /api/v2/auth/... (strip_path: false, 直接透传) # --------------------------------------------------------------------------- - name: auth-service-v2 - url: http://192.168.1.111:3024/api/v2 + url: http://192.168.1.111:3024 routes: - name: auth-v2-api paths: - /api/v2/auth - strip_path: true + strip_path: false - name: auth-v2-health paths: - /api/v2/auth/health - strip_path: true + strip_path: false # --------------------------------------------------------------------------- # Mining Wallet Service 2.0 - 挖矿钱包服务