Fix Rewrite-target regex
This commit is contained in:
parent
7d2b7cd7f1
commit
ba3a579d07
2 changed files with 2 additions and 2 deletions
|
@ -535,7 +535,7 @@ func getRuleForPath(pa extensionsv1beta1.HTTPIngressPath, i *extensionsv1beta1.I
|
|||
if ruleType == ruleTypeReplacePath {
|
||||
return "", fmt.Errorf("rewrite-target must not be used together with annotation %q", annotationKubernetesRuleType)
|
||||
}
|
||||
rewriteTargetRule := fmt.Sprintf("ReplacePathRegex: ^%s/(.*) %s/$1", pa.Path, strings.TrimRight(rewriteTarget, "/"))
|
||||
rewriteTargetRule := fmt.Sprintf("ReplacePathRegex: ^%s(.*) %s$1", pa.Path, strings.TrimRight(rewriteTarget, "/"))
|
||||
rules = append(rules, rewriteTargetRule)
|
||||
}
|
||||
|
||||
|
|
|
@ -1410,7 +1410,7 @@ rateset:
|
|||
frontend("rewrite/api",
|
||||
passHostHeader(),
|
||||
routes(
|
||||
route("/api", "PathPrefix:/api;ReplacePathRegex: ^/api/(.*) /$1"),
|
||||
route("/api", "PathPrefix:/api;ReplacePathRegex: ^/api(.*) $1"),
|
||||
route("rewrite", "Host:rewrite")),
|
||||
),
|
||||
frontend("error-pages/errorpages",
|
||||
|
|
Loading…
Reference in a new issue