How to configure CORS on endpoint /realms/{realm-name}?

Hello everyone,

I need to configure CORS on endpoint /realms/{realm-name}. Basically, I want to block the cross domain requests on this endpoints. By default the requests from the any domains(frontend) can be done on this endpoint.
In my case, the keycloak is deployed on a Kubernetes cluster. It is running being the Nginx ingress. I tried to use Nginx configurations to configure CORS using annotations but it has no effect and it’s getting overridden by Keycloak. In the Keycloak forum I found out the the CORS can be configured using the “Web Origins” field for individual clients. But in this case, I’m not sure where the allowed origins can be added.
Any support here would be highly appreciated!

Keycloak version: 23.0.7