Browse Source

reverseproxy: Fix https active health checks #3450 (#3451)

master
AndyBan 5 years ago
committed by GitHub
parent
commit
22055c5e0f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      modules/caddyhttp/reverseproxy/healthchecks.go

2
modules/caddyhttp/reverseproxy/healthchecks.go

@ -198,7 +198,7 @@ func (h *Handler) doActiveHealthCheckForAllHosts() {
func (h *Handler) doActiveHealthCheck(dialInfo DialInfo, hostAddr string, host Host) error {
// create the URL for the request that acts as a health check
scheme := "http"
if ht, ok := h.Transport.(*http.Transport); ok && ht.TLSClientConfig != nil {
if ht, ok := h.Transport.(TLSTransport); ok && ht.TLSEnabled() {
// this is kind of a hacky way to know if we should use HTTPS, but whatever
scheme = "https"
}

Loading…
Cancel
Save