ldap-nginx-golang

一个简单的golang编写的nginx ldap验证的后端插件, 算一个演示, 主要是用来学习.

Stars
35

Demo, , .

english readme

git clone [email protected]:childe/ldap-nginx-golang.git
cd ldap-nginx-golang
make

https://github.com/childe/ldap-nginx-golang/releases/tag/201607

  1. config.json

    config.example.json, ldap

  2. nginx

     cp nginx.conf /etc/nginx
     nginx -s reload
    

    nginx

    ./nginx-ldap-auth-daemon --config config.json

, config.json, :

    ./nginx-ldap-auth-daemon --host 0.0.0.0 --port 9000 --insecureSkipVerify true

**useSSLinsecureSkipVerify, config.json, golangbooloptions, config.json. interface, .**

./nginx-ldap-auth-daemon --help

nginx

auth_request, , nginx--with-http_auth_request_module.

http://nginx.org/en/docs/http/ngx_http_auth_request_module.html

:

location / {
    auth_request /auth-proxy;

    proxy_pass http://backend/;
}

, /auth-proxy, /auth-proxy401403, ; 2xx, ,nginxhttp://backend/; , .

ldap

ldap:

  1. ldapserver
  2. binddn, bindpw Bindldapserver ()
  3. filter, ldap
  4. DNbind,

http://ohmycat.me/nginx/2016/06/28/nginx-ldap.html

nginxldap,

golang, .