diff --git a/pkg/route/route.go b/pkg/route/route.go index 5178a7ff..1c35e49b 100644 --- a/pkg/route/route.go +++ b/pkg/route/route.go @@ -110,7 +110,8 @@ func AddCustomRoute(route Route, routeACLAnn string, api api.HAProxyClient) (err if route.Path.PathTypeMatch == store.PATH_TYPE_EXACT { routeCond = fmt.Sprintf("%s{ path %s }", routeCond, route.Path.Path) } else { - routeCond = fmt.Sprintf("%s{ path -m beg %s }", routeCond, route.Path.Path) + path := strings.TrimSuffix(route.Path.Path, "/") + routeCond = fmt.Sprintf("%s{ path -m reg ^%s($|/) }", routeCond, path) } } routeCond = fmt.Sprintf("%s { %s } ", routeCond, routeACLAnn)