diff --git a/src/common/core/errors/errors.lua b/src/common/core/errors/errors.lua index 242a424ef..d46cf0b48 100644 --- a/src/common/core/errors/errors.lua +++ b/src/common/core/errors/errors.lua @@ -104,7 +104,7 @@ function errors:render_template(code) -- Override HSTS header local ssl - if self.ctx.bw and self.ctx.bw.https_configured == "yes" then + if self.ctx.bw and self.ctx.bw.scheme == "https" then ssl = true else ssl = ngx.var.scheme == "https" diff --git a/src/common/core/headers/headers.lua b/src/common/core/headers/headers.lua index d93e12e10..cae9ae603 100644 --- a/src/common/core/headers/headers.lua +++ b/src/common/core/headers/headers.lua @@ -80,7 +80,7 @@ end function headers:header() -- Override upstream headers if needed local ngx_header = ngx.header - local ssl = self.ctx.bw.https_configured == "yes" + local ssl = self.ctx.bw.scheme == "https" for variable, header in pairs(self.all_headers) do if ngx_header[header] == nil