Default backend protocol only supports http (#4870)

This commit is contained in:
Manuel Alejandro de Brito Fontes 2020-01-04 11:09:00 -03:00 committed by GitHub
parent eb3fd57bd2
commit 965ecd4b15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -520,6 +520,12 @@ func buildProxyPass(host string, b interface{}, loc interface{}) string {
}
}
// TODO: add support for custom protocols
if location.Backend == "upstream-default-backend" {
proto = "http://"
proxyPass = "proxy_pass"
}
// defProxyPass returns the default proxy_pass, just the name of the upstream
defProxyPass := fmt.Sprintf("%v %s%s;", proxyPass, proto, upstreamName)