Keycloak initialization failed

I’m using Keycloak for SSO, YARP as the API Gateway, .NET 9 Web API, and React for the frontend. I already have a deployed environment where everything works fine when hosted on Windows Server with IIS.

However, I recently migrated to a Linux server (Ubuntu). Now:

  • My API server is running fine.
  • The API Gateway is working.
  • The frontend is deployed and loading.

But I’m getting the error I mentioned earlier (related to CORS or Keycloak), and login via Keycloak doesn’t work properly.

Interestingly, when I run the React app locally using npm run dev and connect it to the remote API Gateway and API, it works perfectly — no issues at all.

So the issue seems to be with the production deployment on the Linux server, but I haven’t been able to pinpoint the exact cause.

Can you please help me identify what might be going wrong?