admin管理员组文章数量:1312727
I'm configuring a GCP Load Balancer with route rules for different backend services based on URL prefixes. I want to match paths like /dev/two/
, /dev/three/
, etc., but all calls are hitting the default service when /dev/
is included in the path.
When I remove /dev/
from the prefix match (e.g., /two/
), everything works fine, but I want to keep /dev/
in the route without it defaulting to the main backend.
Here’s my YAML configuration for the GCP Load Balancer:
defaultService: projects/my-project-101010/global/backendServices/one-back-end
name: matcher1
routeRules:
- matchRules:
- prefixMatch: /dev/two/
priority: 1
routeAction:
weightedBackendServices:
- backendService: projects/my-project-101010/global/backendServices/two-back-end
weight: 100
- matchRules:
- prefixMatch: /dev/three/
priority: 2
routeAction:
weightedBackendServices:
- backendService: projects/my-project-101010/global/backendServices/three-back-end
weight: 100
- matchRules:
- prefixMatch: /dev/four/
priority: 3
routeAction:
weightedBackendServices:
- backendService: projects/my-project-101010/global/backendServices/four-back-end
weight: 100
- matchRules:
- prefixMatch: /dev/five
- prefixMatch: /dev/six
- prefixMatch: /dev/seven
- prefixMatch: /dev/eight
priority: 4
routeAction:
weightedBackendServices:
- backendService: projects/my-project-101010/global/backendServices/five-to-eight-back-end
weight: 100
What I'm trying to achieve:
- I want to route traffic based on
/dev/two/
,/dev/three/
, etc., without it hitting the default service. - The routing should happen only for
/dev/
prefixed URLs and not redirect all traffic to the default backend service.
What I have tried:
- I’ve tried removing the
/dev/
part from the prefix, and it works fine. But I want to keep/dev/
and ensure it doesn't default to the main backend.
Has anyone encountered this issue or has suggestions on how to properly configure the routes with the /dev/
prefix while ensuring correct routing?
本文标签: google cloud platformIssue with GCP Load Balancer Configuration dev Prefix HandlingStack Overflow
版权声明:本文标题:google cloud platform - Issue with GCP Load Balancer Configuration: dev Prefix Handling - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741882897a2402853.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论