fix(consul): 添加Traefik中间件以剥离/api/data前缀
添加stripprefix中间件配置,确保请求路由到data-service时剥离/api/data前缀,避免路径不匹配问题
This commit is contained in:
parent
de5d14befb
commit
5af50cc066
@ -10,7 +10,9 @@
|
||||
"tags": [
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.data-service.rule=PathPrefix(\"/api/data\")",
|
||||
"traefik.http.routers.data-service.entrypoints=web"
|
||||
"traefik.http.routers.data-service.entrypoints=web",
|
||||
"traefik.http.middlewares.data-service-strip.stripprefix.prefixes=/api/data",
|
||||
"traefik.http.routers.data-service.middlewares=data-service-strip"
|
||||
],
|
||||
"name": "data-service",
|
||||
"port": 8000
|
||||
|
||||
Loading…
Reference in New Issue
Block a user