keycloak redirects urls to http instead of https
I was able to resolve this issue. We have dotnet core application and keycloak behing ssl terminating SSL proxy. Nginx setting as mentioned above is correct, the issue was application was not forwarding the headers properly to keyclaok. Following link helped:https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer?view=aspnetcore-2.1
var forwardingOptions = new ForwardedHeadersOptions(){ ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto};forwardingOptions.KnownNetworks.Clear(); //its loopback by defaultforwardingOptions.KnownProxies.Clear();app.UseForwardedHeaders(forwardingOptions);
this code block from another answer solved the issue for me. .net Core X Forwarded Proto not working