From 2c9675b48bd32f1d14d2e3a315d903e016b0b0c3 Mon Sep 17 00:00:00 2001 From: joyov <56232119+joyov@users.noreply.github.com> Date: Fri, 11 Oct 2019 20:01:18 +0200 Subject: [PATCH] Fix scheme detection when reverse proxy is used --- pkg/api/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/api/server.go b/pkg/api/server.go index bbda0a649..85fe2e05a 100644 --- a/pkg/api/server.go +++ b/pkg/api/server.go @@ -222,7 +222,7 @@ func BaseURLMiddleware(next http.Handler) http.Handler { ctx := r.Context() var scheme string - if strings.Compare("https", r.URL.Scheme) == 0 || r.Proto == "HTTP/2.0" { + if strings.Compare("https", r.URL.Scheme) == 0 || r.Proto == "HTTP/2.0" || r.Header.Get("X-Forwarded-Proto") == "https" { scheme = "https" } else { scheme = "http"