fix(consul): 为前端和数据服务添加Traefik路由优先级

添加traefik.http.routers.frontend.priority=10和traefik.http.routers.data-service.priority=100配置,确保API请求优先于前端路由处理
This commit is contained in:
fanfpy 2025-07-16 13:41:12 +08:00
parent 1819c9e111
commit edeb71d74c
2 changed files with 2 additions and 0 deletions

View File

@ -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"

View File

@ -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",