Merge pull request #2808 from dongqi1990/bugfix-2799

fix the bug #2799, add prefix (?i) in rewrite statement.
This commit is contained in:
k8s-ci-robot 2018-08-02 20:58:06 -07:00 committed by GitHub
commit 23ce9b5db1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 139 additions and 120 deletions

View file

@ -474,14 +474,14 @@ subs_filter '%v' '$1<base href="%v://$http_host%v">' ro;
// special case redirect to /
// ie /something to /
return fmt.Sprintf(`
rewrite %s(.*) /$1 break;
rewrite %s / break;
rewrite (?i)%s(.*) /$1 break;
rewrite (?i)%s / break;
%v%v %s://%s;
%v`, path, location.Path, xForwardedPrefix, proxyPass, proto, upstreamName, abu)
}
return fmt.Sprintf(`
rewrite %s(.*) %s/$1 break;
rewrite (?i)%s(.*) %s/$1 break;
%v%v %s://%s;
%v`, path, location.Rewrite.Target, xForwardedPrefix, proxyPass, proto, upstreamName, abu)
}