kvspb / nginx-auth-ldap

LDAP authentication module for nginx
BSD 2-Clause "Simplified" License
735 stars 252 forks source link

Several ways to setup cache settings, just one correct? #87

Open fleximus opened 9 years ago

fleximus commented 9 years ago

Hi,

while trying to figure out the correct settings to activate the cache I found out that there are at least three ways to have a positive nginx configtest, but only one seems to be correct.

configtest OK, works NOT correctly:

ldap_server myldap {
    auth_ldap_cache_enabled on;
    auth_ldap_cache_expiration_time 100;
    auth_ldap_cache_size 1000;
}

server {
}

configtest OK, works NOT correctly:

ldap_server myldap {
    cache_enabled on;
    cache_expiration_time 100;
    cache_size 1000;
}

server {
}

configtest OK, works correctly

ldap_server myldap {
}

auth_ldap_cache_enabled on;
auth_ldap_cache_expiration_time 100;
auth_ldap_cache_size 1000;

server {
}

I'd like to propose having configtest fail for the incorrect ones and an updated documentation.

delfuego commented 9 years ago

+1 for, at a minimum, documenting the cache settings. I had to find issue #8 in order to know they existed at all.

CGavrila commented 8 years ago

This did it for me:

http {
  ...
  auth_ldap_cache_enabled on;
  auth_ldap_cache_expiration_time 10000;
  auth_ldap_cache_size 1000;
  ...
}

I would gladly raise a PR, but I'm not sure I understand what units this is using - I'm guessing seconds and KB?

landryb commented 6 years ago

for the expiration time, it seems the code and the doc refer to milliseconds, but the behaviour seems to be in seconds. I'm puzzled.