Browse Source

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.
master
Matthew Holt 5 years ago
parent
commit
1c17e6c6bb
No known key found for this signature in database GPG Key ID: 2A349DD577D586A5
  1. 9
      modules/caddyhttp/reverseproxy/caddyfile.go

9
modules/caddyhttp/reverseproxy/caddyfile.go

@ -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 // the underlying JSON does not yet support different
// transports (protocols or schemes) to each backend, // transports (protocols or schemes) to each backend,
// so we remember the last one we see and compare them // so we remember the last one we see and compare them

Loading…
Cancel
Save