You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If Kong is behind a load balancer a check for https is not working because it's always off. You should additionally check for the header value in X-Forwarded-Proto. If not "https" then you should redirect.
This should work behind a load balancer (at least it works on Heroku):
function HttpFilterHandler:access(conf)
HttpFilterHandler.super.access(self)
if ngx.var.https ~= "on" and ngx.var.http_x_forwarded_proto ~= "https" then
return ngx.redirect("https://" .. ngx.var.host .. ngx.var.request_uri, ngx.HTTP_MOVED_PERMANENTLY)
end
end
If Kong is behind a load balancer a check for https is not working because it's always off. You should additionally check for the header value in X-Forwarded-Proto. If not "https" then you should redirect.
This should work behind a load balancer (at least it works on Heroku):