Simplify x-forwarded-prefix annotation

This commit is contained in:
Alex Kursell 2019-03-11 12:23:14 -04:00
parent 1ed1dd588a
commit 188295550c
7 changed files with 106 additions and 22 deletions

View file

@ -456,8 +456,8 @@ func buildProxyPass(host string, b interface{}, loc interface{}) string {
if len(location.Rewrite.Target) > 0 {
var xForwardedPrefix string
if location.XForwardedPrefix {
xForwardedPrefix = fmt.Sprintf("proxy_set_header X-Forwarded-Prefix \"%s\";\n", path)
if len(location.XForwardedPrefix) > 0 {
xForwardedPrefix = fmt.Sprintf("proxy_set_header X-Forwarded-Prefix \"%s\";\n", location.XForwardedPrefix)
}
return fmt.Sprintf(`