Eddy
Eddy

Reputation: 41

nginx-ldap-auth - authentication timed out, but ldapsearch works fine

I have installed nginx with nginx-auth-ldap module, I followed guide on github and now nginx error log show me smth like that:

2015/05/13 08:24:31 [error] 18696#0: *56 http_auth_ldap: Authentication timed out, client:***
2015/05/13 08:24:31 [error] 18696#0: *57 http_auth_ldap: Authentication timed out, client:***

But ldapsearch is OK with requests - it finds users sAMAccountName and Linuxc, ldap server is reachable (64 bytes from xxx.xxx.xxx.xxx: icmp_seq=1 ttl=127 time=112 ms). Why am I getting errors? I am stuck and have no ideas, ANY help is appreciated.

nginx 1.6.2 version. my nginx.conf file:

ldap_server ad_1 {
url "ldap://xxx.xxx.xxx.xxx:389/DC=some,DC=org,DC=com?sAMAccountName?sub?(objectClass=person)";
connections 30;
binddn 'CN=Linuxc,OU=Support,OU=Company,DC=some,DC=org,DC=com';
binddn_passwd 'somepasswd';
group_attribute member;
group_attribute_is_dn on;
satisfy any;
require valid_user;
}

And in conf.d folder conf file is:

location / {
    auth_ldap "Forbidden";
    auth_ldap_servers ad_1;
    root /var/www/kibana3;
    index index.html index.htm
}

Upvotes: 1

Views: 4955

Answers (1)

Stepan Kokhanovskiy
Stepan Kokhanovskiy

Reputation: 642

Try add this directives in your *.conf file to enable cache in ldap module:

ldap_server {
    ...
}

auth_ldap_cache_enabled on;            # enable cache
auth_ldap_cache_expiration_time 10000; # 10 sec
auth_ldap_cache_size 1000;             # max 1000 records in cache

server {
    ...
}

Upvotes: 3

Related Questions