Merge pull request #2808 from dongqi1990/bugfix-2799
fix the bug #2799, add prefix (?i) in rewrite statement.
This commit is contained in:
commit
23ce9b5db1
5 changed files with 139 additions and 120 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue