一个简单的golang编写的nginx ldap验证的后端插件, 算一个演示, 主要是用来学习.
Demo, , .
git clone [email protected]:childe/ldap-nginx-golang.git
cd ldap-nginx-golang
make
https://github.com/childe/ldap-nginx-golang/releases/tag/201607
config.json
config.example.json, ldap
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
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:
http://ohmycat.me/nginx/2016/06/28/nginx-ldap.html
golang, .