Keycloak-protected webapp behind loadbalancer - wrong redirect_uri by Keycloak

Hey,

I have a webapplication that is secured by Keycloak. That webapp is accesible through a loadbalancer.
Url of the loadbalancer is

https://lb.xxx:8443/webapp

When i go to that url I get redirected to the Keycloak-server for authentication, but I get an ‘invalid parameter: invalid redirect_uri’ error message. And if I look at the querystring, then the redirect_uri uses

http://lb.xxx....

instead of

https://lb.xxx...

and the url with just http is not set as a valid redirect uri in the admin panel.
Why does Keycloak change the scheme of the url from https to http?? Is it because of the load balancer
Did I forget to configure something? If I test everything locally on localhost everything works fine, but once on our testserver (with loadbalancing) it changes the url…any help is appreciated!