nginx-ldap-auth - 身份验证超时,但ldapsearch工作正常

时间:2015-05-13 05:39:45

标签: nginx ldap

我已经使用nginx-auth-ldap模块安装了nginx,我在github上关注了指南,现在nginx错误日志显示我就像那样:

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:***

但ldapsearch对请求没问题 - 它找到用户sAMAccountName和Linuxc,ldap服务器是可以访问的(64字节来自xxx.xxx.xxx.xxx:icmp_seq = 1 ttl = 127 time = 112 ms)。为什么我会收到错误?我被困住了,没有任何想法,感谢任何帮助。

nginx 1.6.2版本。 我的nginx.conf文件:

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;
}

在conf.d文件夹中conf文件是:

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

1 个答案:

答案 0 :(得分:1)

尝试在* .conf文件中添加此指令以在ldap模块中启用缓存:

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 {
    ...
}
相关问题