Keycloak does not work behind a load balancer

I know there is a lot of similar questions but they don’t seem to work me.

I installed keycloak in a Kubernetes cluster using bitnami helm chart. This cluster is in a private VPN network. Normally I would use cert-manager to create certificates and enable HTTPS.

But in this scenario, I installed it without SSL and left the SSL stuff to load balancer in this private network.

The thing is it works but only some portions of it. At first, I was getting an invalid redirect error when I try to open the admin console. But then I added the DNS address to /etc/hosts file(this way browser says invalid cert but when I say accept the risk it works perfectly) and now I can login. After I login I changed to Valid URL in the secure-admin-console to *.

Now I can login without the /etc/hosts hack but After I login I get:
Failed to execute ‘postMessage’ on ‘DOMWindow’: The target origin provided (‘http://my-address.com’) does not match the recipient window’s origin (‘https://my-address.com’).

Notice the difference is only about HTTP → HTTPS

I think this is about the X-Forwardes-For and X-Forwardes-Proto headers but I am not the sysadmin there. And I think sysadmin made the correct configuration

Can there be any other possible problem that I should focus on?

https://www.keycloak.org/docs/latest/server_installation/index.html#_setting-up-a-load-balancer-or-proxy

I tried those. No help. I am just curious about what the “Failed to execute ‘postMessage’ on ‘DOMWindow’: The target origin provided” message means.

I am not sure about what it indicates.