1
0
Fork 0

Allow empty path with App-root annotation

This commit is contained in:
Daniel Tomcej 2018-12-26 04:52:03 -06:00 committed by Traefiker Bot
parent bc6e9d5042
commit f7c6c562a5
2 changed files with 25 additions and 1 deletions

View file

@ -939,7 +939,7 @@ func loadAuthTLSSecret(namespace, secretName string, k8sClient Client) (string,
func getFrontendRedirect(i *extensionsv1beta1.Ingress, baseName, path string) *types.Redirect {
permanent := getBoolValue(i.Annotations, annotationKubernetesRedirectPermanent, false)
if appRoot := getStringValue(i.Annotations, annotationKubernetesAppRoot, ""); appRoot != "" && path == "/" {
if appRoot := getStringValue(i.Annotations, annotationKubernetesAppRoot, ""); appRoot != "" && (path == "/" || path == "") {
return &types.Redirect{
Regex: fmt.Sprintf("%s$", baseName),
Replacement: fmt.Sprintf("%s/%s", strings.TrimRight(baseName, "/"), strings.TrimLeft(appRoot, "/")),