Keycloak 26 on Kubernetes: Mixed Content Error

Rian Schmidt

October 13, 2024

Table of Contents:

I'm not going to explain much here... but...
It's just an environment variable.

This is going to be a quicky, but since I just farted around for a couple of hours trying to figure it out-- led astray by our friend, AI, and then old SO posts-- I thought I'd record what turned out to be the answer for me:

I'm not going to explain much here... but...

I assume if you found this, you know what Kubernetes does, and you know what Keycloak does, and you're just wasting your precious life guessing at the secret. Well, friends, your ol' Uncle Rian is here for you.

It's just an environment variable.

Assuming you've got a pretty vanilla Kubernetes installation-- mine is microK8s on Ubuntu, but I get the feeling that this is a Keycloak v26 thing more than a particular k8s thing:

Do this:

        - name: KC_PROXY_HEADERS
          value: "xforwarded"

In your deployment env vars section.

I'd say let me know how it goes, but I don't have commenting enable at the moment

Circinaut is a Fractional CTO services provider, based in Portland, Oregon, working with clients all across the country. I focus on application development, technology advising, and ongoing support for small and medium-sized businesses.
If your business is in need of a part-time CTO, a fractional CTO, or a contract technical consultant, drop me a line. I'm happy to have a quick chat to discuss your situation with no sales pressure at all (really!).