reverseproxy: Allow using TLS for port 80 upstreams (see #3361)

An upstream like https://localhost:80 is still forbidden, but an addr of
localhost:80 can be used while explicitly enabling TLS as an override;
we just don't allow the implicit behavior to be ambiguous.
This commit is contained in:
Matthew Holt 2020-05-06 12:37:44 -06:00
parent b814c0af9c
commit 1c17e6c6bb
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5

View file

@ -151,15 +151,6 @@ func (h *Handler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
}
}
// if scheme is not set, we may be able to infer it from a known port
if scheme == "" {
if port == "80" {
scheme = "http"
} else if port == "443" {
scheme = "https"
}
}
// the underlying JSON does not yet support different
// transports (protocols or schemes) to each backend,
// so we remember the last one we see and compare them