Apache2 ldap authorization with dynamic group name based on server name

I have multiple VirtualHosts and some of them require authorization. I have one config that I include in those hosts that handles basic authentication. I would like apache to lookup group based on server name I've tried

Require ldap-group cn=%{SERVER_NAME},ou=Groups,dc=example,dc=com

but unfortunately the variable is not resolved. Any tips?


The answer is spaces between identifiers, so

Require ldap-group cn=%{SERVER_NAME}, ou=Groups, dc=example, dc=com

See example 5 in the official documentation