I am trying to migrate my docker script for KC for newer version and keep getting problems.
I saw there are somechanges, regarding “PROXY” config because I am runnung nginx reverse proxy, but still havent been able to make it work… Any tips what all i need to change?
I am also getting:
Key material not provided to setup HTTPS. Please configure your keys/certificates or start the server in development mode
and Because I run reverse proxy before, how to best approach this?
You probably want the hostname specified as full URL (https://… ) adn make sure that your reverse proxy does set all needed X- Forwarded-… headers correctly.
Running production Keycloak behind a reverse proxy requires 4 main env parameters to be provided.
KC_PROXY_HEADERS=xforwarded
PROXY_ADDRESS_FORWARDING=true
KC_HTTP_ENABLED=true
KC_HOSTNAME=myapp.com
Using these should make it work. These are currently working on my Keycloak deployment of version 26.0.5.
Make sure you dont miss out providing KC_HOSTNAME env variable (I know I did and spent some time banging my head around )
Making this claim as a general statement is not correct. Perhaps these are the proper values for YOUR environment, but not generally. As mostly, it depends!
KC_PROXY_HEADERS might be forwarded or xforwarded, depending on what the reverse-proxy sends. Nginx can be configured to send either the one or the other.
PROXY_ADDRESS_FORWARDING is NOT a valid Keycloak environment variable. No, not even because many medium blog post mentioning this. This is wrong.
KC_HTTP_ENABLED what if the reverse-proxy should only talk via HTTPS to Keycloak? Then this is wrong.
KC_HOSTNAME is not necessary for Keycloak working properly behind a reverse-proxy. This also depends on other conigurations if this is required or not.
So, unfortunately using YOUR config as a general config is probably not the best solution. Sorry to say that.