AriStockAI/consul/config/data-service.json
fanfpy 5af50cc066 fix(consul): 添加Traefik中间件以剥离/api/data前缀
添加stripprefix中间件配置,确保请求路由到data-service时剥离/api/data前缀,避免路径不匹配问题
2025-07-06 12:28:20 +08:00

20 lines
635 B
JSON

{
"service": {
"address": "data-service",
"check": {
"http": "http://ari-data-service:8000/api/public/stock_bid_ask_em?symbol=000001",
"interval": "10s",
"timeout": "5s"
},
"id": "data-service-1",
"tags": [
"traefik.enable=true",
"traefik.http.routers.data-service.rule=PathPrefix(\"/api/data\")",
"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
}
}