I have a Keycloak v16 which was installed via Bitnami/Keycloak Helm Chart v7.1.7 and it works pretty well.
Now I need to upgrade Keycloak v18 by using Bitnami/Keycloak Helm Chart v9.0.0 .
This is my system:
http/https >>>> ALB (SSL Offloading)>>> (http) Nginx Ingress >>> (http) Keycloak
my existing Keycloak v16 settings are:
You have ALB → Nginx → Keycloak = Keycloak behind 2 proxies. Nginx must set X-Forwarded headers based on current X-Forwarded headers (or just hardcode them), not based on request. I guess ALB is doing SSL offloading so nginx receives http request and set it to X-Forwarded header as well. So Keycloak is only following what those proxies configure in X-Forwarded headers. It is your proxy issue, not a Keycloak issue.
also I tried the bıth configs above with proxy: edge and proxy: passthrough, nothing works. Keycloak doesn’t care proxy config; nothing changes. Keycloak looks for http:// endpoint persistently.
DEBUG [org.keycloak.services.error.KeycloakErrorHandler] (executor-thread-0) Error response 404: javax.ws.rs.NotFoundException: RESTEASY003210: Could not find resource for full path: http://keycloak.mydomain.com/auth/
And I got the “Invalid parameter: redirect_uri” error from Keycloak while I was trying to access the admin console login page.
Thanks for @jangaraj’s hints, the problem should be related to the header x-forwarded-proto / x-forwarded-scheme are http when Keycloak received the request from Nginx, and the redirect_uri is https://… because the browser is using https to access Keycloak.
I think due to the protocol is different which caused Keycloak complaint it.
My solution is to change my infrastructure as below (which made the protocol aligned to use HTTPS):
Try setting up the 2 ENV variables as below:
KC_HOSTNAME → Hostname of your app (e.g. app.domain.com)
KC_HOSTNAME_ADMIN → Admin console Hostname (e.g admin.domain.com)