auth_ldap_servers_size
The `auth_ldap_servers_size` directive specifies the maximum number of LDAP servers that can be defined in the configuration for authentication purposes.
Description
The auth_ldap_servers_size directive within the NGINX LDAP Authentication module is designed to set a limit on the number of LDAP servers that can be specified in the configuration. This directive is important for managing resources and ensuring that configurations remain manageable, particularly in larger environments with multiple LDAP servers. The directive accepts a single integer argument, which denotes the maximum number of servers that can be configured for LDAP authentication. If the number of defined LDAP servers exceeds this limit, the configuration will not be valid, leading to errors when NGINX is restarted or reloaded.
When using this directive, it is essential to consider the potential need for multiple servers for redundancy, load balancing, or failover scenarios. By configuring the maximum server size, administrators can prevent excessive resource allocation and maintain the performance of the NGINX server, particularly under high load situations. This directive complements other configuration directives related to LDAP authentication by ensuring that the defined parameters remain within a reasonable scope, thus fostering a more stable and predictable environment for user authentication processes.
Config Example
http {
auth_ldap_servers_size 5;
ldap_server server1 {
url ldap://192.168.1.1:389/dc=example,dc=com?sAMAccountName
binddn "cn=admin,dc=example,dc=com";
binddn_passwd "password";
}
ldap_server server2 {
url ldap://192.168.1.2:389/dc=example,dc=com?sAMAccountName
binddn "cn=admin,dc=example,dc=com";
binddn_passwd "password";
}
}Exceeding the defined limit will result in configuration errors during NGINX reload.
The directive must be included in the appropriate context; it can only be set in the http block.
Make sure the actual number of defined servers does not exceed the value set by this directive.