git clone https://github.com/kvspb/nginx-auth-ldap.git
./configure --add-module=path_to_http_auth_ldap_module make install
group_attribute People 这个是验证的时候,访问哪个组
http { ldap_server test2 { url ldap://172.16.6.13:389/DC=ptmind,DC=com?cn?sub?(objectClass=person); binddn "cn=ldap,dc=ptmind,dc=com"; binddn_passwd xxxxxxxxx; group_attribute People; group_attribute_is_dn on; require valid_user; } }
server { listen 8000; server_name localhost; location / { root html; index index.html index.htm; auth_ldap "Forbidden"; auth_ldap_servers test2; } }
本文出自 “杜云龙” 博客,请务必保留此出处http://duyunlong.blog.51cto.com/1054716/1896137
原文地址:http://duyunlong.blog.51cto.com/1054716/1896137