From 3c9806ccb63e66bdcac8e1ed4520c9d135cb011d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kiss=20K=C3=A1roly?= Date: Tue, 14 Jun 2022 15:42:33 +0200 Subject: [PATCH] Solve issue when dynamic upstreams use wrong protocol upstream. --- modules/caddyhttp/reverseproxy/httptransport.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/caddyhttp/reverseproxy/httptransport.go b/modules/caddyhttp/reverseproxy/httptransport.go index a373f9091..96442c4e1 100644 --- a/modules/caddyhttp/reverseproxy/httptransport.go +++ b/modules/caddyhttp/reverseproxy/httptransport.go @@ -298,7 +298,7 @@ func (h *HTTPTransport) RoundTrip(req *http.Request) (*http.Response, error) { func (h *HTTPTransport) SetScheme(req *http.Request) { if req.URL.Scheme == "" { req.URL.Scheme = "http" - if h.TLS != nil { + if h.TLS != nil && req.URL.Port() != "80" { req.URL.Scheme = "https" } }