Your application can determine the domain only when serving a request. (Thus, it is available for controllers in request
.) In the initializer, which is executed once, at startup, before submitting any requests, this is not possible. (If you, the maintainer, do not know the domain in advance, and specify it in the configuration, for example, in an environment variable.)
Even one application can work in several domains. Then each request can have a different domain.
source share