Change the front page basing on the domain
I've already find the answer by referring to Programmatically set the front page per site?. It is much simpler than the reference, because I just want to map the domain with my static page and I don't have a multisite drupal.
So, I just add an event subscriber and put all the mapping there.


  In the getSubscribedEvents method you need to set the weight to something greater than 30 which overrides the Page Cache and Dynamic Cache.


$events['kernel.request'] = ['kernel_request', '35'];



  Add this function in the same event subscriber file


public function kernel_request(Event $event) {
$config = \Drupal::configFactory()-&gt;getEditable('system.site');
$site_path = \Drupal::service('site.path');
$site_path = explode('/', $site_path);
$site_name = $site_path[1];

if ($site_name === 'site2' &amp;&amp; $event-&gt;getRequest()-&gt;getPathInfo() == '/') {
  $config-&gt;set('page.front', '/node/239')-&gt;save();
}
else {
  $config-&gt;set('page.front', '/home-content')-&gt;save();

}
}