How to enable Active Directory authentication for Gitwin Gitweb?

Gitwin's Nginx web server has built-in support for LDAP authentication allowing you to use AD authentication. Follow steps below:

  • Create a dedicated AD service account for LDAP queries (say ldapreq, domain example.local)
  • Start a text editor capable of editing a text file with Unix line endings (Wordpad or Notepad++ for example)
  • Edit file <Gitwin installation directory>\etc\nginx\nginx.conf
http {
....
ldap_server DCGC1 {
    url ldap://192.168.0.1:3268/DC=example,DC=local?sAMAccountName?sub?(objectClass=person);
    binddn "EXAMPLE\\ldapreq";
    binddn_passwd password;
    group_attribute uniquemember;
    group_attribute_is_dn on;
    require valid_user;
}
 
ldap_server DCGC2 {
    url ldap://192.168.0.2:3268/DC=example,DC=local?sAMAccountName?sub?(objectClass=person);
    binddn "EXAMPLE\\ldapreq";
    binddn_passwd password;
    group_attribute uniquemember;
    group_attribute_is_dn on;
    require valid_user;
}
 
server {
listen       9610;
server_name  localhost;
 
auth_ldap "Restricted";
auth_ldap_servers DCGC1,DCGC2;
 
 ....
 
  • Restart Gitwin_Nginx service
 
Useful links: