Issue userId=null when upgrading keycloack

Hi
We are trying to upgrade Keycloak from version 3.4.1 to 15.0.0, and everything seems to be fine, but when trying to login it doesn’t recognize the user
image
while checking the logs, we are getting:

WARN  [org.keycloak.events] (default task-2) type=LOGIN_ERROR, realmId=2ea5b43c-9917-44fe-bde0-e140154d573d, clientId=my-app, userId=null, ipAddress=xxx.xxx.xxx.xxx, error=user_not_found, auth_method=openid-connect, auth_type=code, redirect_uri=https://localhost/my/app/

the whole app is running on docker.
We are using apache as a reverse proxy, we have followed the documentation for the routing; and it seems to be fine. When we check it, by opening the https://localhost/auth/realms/my-app/.well-known/openid-configuration it returns

{
  "issuer": "http://localhost/auth/realms/my-app",
  "authorization_endpoint": "http://localhost/auth/realms/my-app/protocol/openid-connect/auth",
  "token_endpoint": "http://localhost/auth/realms/my-app/protocol/openid-connect/token",
  "introspection_endpoint": "http://localhost/auth/realms/my-app/protocol/openid-connect/token/introspect",
  "userinfo_endpoint": "http://localhost/auth/realms/my-app/protocol/openid-connect/userinfo",
  "end_session_endpoint": "http://localhost/auth/realms/my-app/protocol/openid-connect/logout",
  "jwks_uri": "http://localhost/auth/realms/my-app/protocol/openid-connect/certs",
  "check_session_iframe": "http://localhost/auth/realms/my-app/protocol/openid-connect/login-status-iframe.html",
...
}

But it looks like somewhere between the proxy and keycloak the user is lost. Any idea how to solve this ?

Thanks.