reverseproxy: caddyfile: Don't add port if upstream has placeholder (#3819)
* check if the host is a placeholder * Update modules/caddyhttp/reverseproxy/caddyfile.go Co-authored-by: Matt Holt <mholt@users.noreply.github.com>pull/3829/head
parent
db4f1c0277
commit
c9fdff9976
|
@ -155,7 +155,9 @@ func (h *Handler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
host = upstreamAddr
|
host = upstreamAddr
|
||||||
}
|
}
|
||||||
if port == "" {
|
// we can assume a port if only a hostname is specified, but use of a
|
||||||
|
// placeholder without a port likely means a port will be filled in
|
||||||
|
if port == "" && !strings.Contains(host, "{") {
|
||||||
port = "80"
|
port = "80"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue