How to authenticate nginx with ldap?

Multi tool use
Multi tool use


How to authenticate nginx with ldap?



I follow this reference https://github.com/kvspb/nginx-auth-ldap/blob/master/README.md and try to integrate nginx and LDAP.



my nginx.conf setting:


user nginx;
worker_processes 4;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}

http {
ldap_server ldap_local {
url "ldap://localhost/cn=Manager,dc=xinhua?uid?sub?(objectClass=posixAccount)";
binddn "cn=Manager,dc=xinhua,dc=org";
binddn_passwd "xxxxxx";
require group "cn=config,ou=People,dc=xinhua,dc=org";
group_attribute "memberUid";
group_attribute_is_dn off;
require valid_user;
satisfy all;
}
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

#gzip on;
include /etc/nginx/conf.d/*.conf;
}



conf.d/default.conf


server {
listen 8000;
server_name localhost;

#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
auth_ldap "Forbidden";
auth_ldap_servers ldap_local;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}



My question is how to authenticate the username and password which are in LDAP.





This is my first time to use LDAP.



Now, I don't know what is the username and password.



When I try the username and password in .htpasswd. It doesn't work.


.htpasswd









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

QrvA9wYy9BWlpDy0nd3e3IMWuJJTASaR 76e l 3EU i0nYNXN0eQh,bC x,B3d7WsnK
avnUH,lj8U,D2NOytjPSnw jp

Popular posts from this blog

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?

Create weekly swift ios local notifications