From edeb71d74cf85729b2dcda59ebc9709e93bbccbf Mon Sep 17 00:00:00 2001 From: fanfpy Date: Wed, 16 Jul 2025 13:41:12 +0800 Subject: [PATCH] =?UTF-8?q?fix(consul):=20=E4=B8=BA=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E5=92=8C=E6=95=B0=E6=8D=AE=E6=9C=8D=E5=8A=A1=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?Traefik=E8=B7=AF=E7=94=B1=E4=BC=98=E5=85=88=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加traefik.http.routers.frontend.priority=10和traefik.http.routers.data-service.priority=100配置,确保API请求优先于前端路由处理 --- consul/config/dev/data-service.json | 1 + consul/config/dev/frontend.json | 1 + 2 files changed, 2 insertions(+) diff --git a/consul/config/dev/data-service.json b/consul/config/dev/data-service.json index 69d5d4a..1221d5d 100644 --- a/consul/config/dev/data-service.json +++ b/consul/config/dev/data-service.json @@ -10,6 +10,7 @@ "tags": [ "traefik.enable=true", "traefik.http.routers.data-service.rule=PathPrefix(`/api/data`) || PathPrefix(`/api/public`)", + "traefik.http.routers.data-service.priority=100", "traefik.http.routers.data-service.entrypoints=web", "traefik.http.middlewares.data-service-stripprefix.stripprefix.prefixes=/api/data,/api/public", "traefik.http.routers.data-service.middlewares=data-service-stripprefix@consulcatalog" diff --git a/consul/config/dev/frontend.json b/consul/config/dev/frontend.json index 03e5b30..d9a4318 100644 --- a/consul/config/dev/frontend.json +++ b/consul/config/dev/frontend.json @@ -10,6 +10,7 @@ "tags": [ "traefik.enable=true", "traefik.http.routers.frontend.rule=PathPrefix(`/`) || PathPrefix(`/index.html`) || PathPrefix(`/static`)", + "traefik.http.routers.frontend.priority=10", "traefik.http.routers.frontend.entrypoints=web" ], "name": "frontend",