如果要精确匹配 /third/factory/device/healthcheck
路径,可以在 rules.http.paths
中直接配置如下:
- path: /third/factory/device/healthcheck
pathType: Exact
backend:
service:
name: test-blavaplus-api-service
port:
number: 80
这里的关键是将 pathType
设置为 Exact
,表示只有当请求路径完全等于 /third/factory/device/healthcheck
时才会匹配到对应的 backend。注意,这种方式不支持 query 参数,如果请求携带了参数,则不会匹配成功。