fix(consul): 为前端和数据服务添加Traefik路由优先级
添加traefik.http.routers.frontend.priority=10和traefik.http.routers.data-service.priority=100配置,确保API请求优先于前端路由处理
This commit is contained in:
parent
1819c9e111
commit
edeb71d74c
@ -10,6 +10,7 @@
|
|||||||
"tags": [
|
"tags": [
|
||||||
"traefik.enable=true",
|
"traefik.enable=true",
|
||||||
"traefik.http.routers.data-service.rule=PathPrefix(`/api/data`) || PathPrefix(`/api/public`)",
|
"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.routers.data-service.entrypoints=web",
|
||||||
"traefik.http.middlewares.data-service-stripprefix.stripprefix.prefixes=/api/data,/api/public",
|
"traefik.http.middlewares.data-service-stripprefix.stripprefix.prefixes=/api/data,/api/public",
|
||||||
"traefik.http.routers.data-service.middlewares=data-service-stripprefix@consulcatalog"
|
"traefik.http.routers.data-service.middlewares=data-service-stripprefix@consulcatalog"
|
||||||
|
|||||||
@ -10,6 +10,7 @@
|
|||||||
"tags": [
|
"tags": [
|
||||||
"traefik.enable=true",
|
"traefik.enable=true",
|
||||||
"traefik.http.routers.frontend.rule=PathPrefix(`/`) || PathPrefix(`/index.html`) || PathPrefix(`/static`)",
|
"traefik.http.routers.frontend.rule=PathPrefix(`/`) || PathPrefix(`/index.html`) || PathPrefix(`/static`)",
|
||||||
|
"traefik.http.routers.frontend.priority=10",
|
||||||
"traefik.http.routers.frontend.entrypoints=web"
|
"traefik.http.routers.frontend.entrypoints=web"
|
||||||
],
|
],
|
||||||
"name": "frontend",
|
"name": "frontend",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user