fix the bug #2799, add prefix (?i) in rewrite statement and add new e2e

test.
This commit is contained in:
dongqi1990 2018-07-18 22:08:37 +08:00
parent 50084b1167
commit 72a2aa171a
5 changed files with 139 additions and 120 deletions

View file

@ -446,14 +446,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)
}