{
# adding access to manager for admin
my $vhost_manager = "sso-manager.$domain";
#1 declare vhost
$conf->{vhostOptions}->{$vhost_manager}->{vhostHttps} = 1; # 1 = HTTPS, 0 = HTTP
$conf->{vhostOptions}->{$vhost_manager}->{vhostPort}  = 443;

#2 access rule
#$conf->{locationRules}->{$vhost_manager}->{'^/.*'} = '$uid eq "admin"';
if ( ! exists $conf->{locationRules}->{$vhost_manager}->{'^/.*'} ) {
  $conf->{locationRules}->{$vhost_manager}->{'^/.*'} = '$uid eq "admin" or $groups =~ /\badmin\b/';
}
$conf->{locationRules}->{$vhost_manager}->{'default'} = 'deny';

#3 default needed values
#$conf->{vhostOptions}->{$vhost_manager}->{staticFileDir} = '/usr/share/lemonldap-ng/manager/static/';
#$conf->{vhostOptions}->{$vhost_manager}->{languages}     = 'fr, en';
$conf->{managerUrl} = $vhost_manager;

#4 optional remove example
my @domains_to_delete = (
    'manager.example.com',
    'auth.example.com',
    'test1.example.com',
    'test2.example.com'
);
foreach my $domain (@domains_to_delete) {
    delete $conf->{vhostOptions}->{$domain};
    delete $conf->{locationRules}->{$domain};
    delete $conf->{exportedHeaders}->{$domain}; 
    }
}
