kvspb / nginx-auth-ldap

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

nginx: [emerg] http_auth_ldap: parse_require in /etc/nginx/conf.d/ldap.conf #88

Closed bbigras closed 8 years ago

bbigras commented 9 years ago

I just updated both nginx (to 1.9.2) and nginx-auth-ldap and I got the following messages when I run nginx -t.

I'm not sure if it's just a message or if it's an error. I think I didn't have this in the past.

bbigras@ubuntu:~/nginx$ sudo nginx -t
nginx: [emerg] http_auth_ldap: parse_require in /etc/nginx/conf.d/ldap.conf:5
nginx: [emerg] http_auth_ldap: Setting group in /etc/nginx/conf.d/ldap.conf:5
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

ldap.conf

ldap_server server1 {
        url ldaps://host:636/ou=something,o=NET?uid?sub?(objectClass=person);
        group_attribute member;
        group_attribute_is_dn on;
        require group "cn=test,ou=something,o=NET";
        binddn "cn=test,ou=something,o=NET";
        binddn_passwd "pass";
}
hugoboos commented 9 years ago

I have the same issue. It is introduced in #85. The ngx_conf_log_error is used to debug, instead of ngx_log_debug.

danfinn commented 9 years ago

just ran into this myself trying to use nginx-auth-ldap for the first time

it appears to be just a warning or a bogus error? things still seem to be functioning as expected.

saviokmua commented 9 years ago

I have the same issue. Please help!...

gbjtv commented 9 years ago

same here.

landryb commented 8 years ago

Can this be reverted or fixed ? #85 is clearly wrong, regular users will think their config is wrong..

TheCase commented 8 years ago

See #95

bbigras commented 8 years ago

95 was merged a day ago. Now the messages are labeled as [notice] instead of [emerg].

@kvspb You close the duplicate issues #98 and #103

hatdropper1977 commented 6 years ago

I compiled nginx-1.13.5 with the @kvspb patch. When I use the following config file, I get the parse error.

http {
    include mime.types;
    default_type application/octet-stream;

    client_body_timeout 12;
    client_header_timeout 12;
    keepalive_timeout 15;
    send_timeout 10;

    gzip on;

    auth_ldap_cache_enabled on;
    auth_ldap_cache_expiration_time 10000;
    auth_ldap_cache_size 1000;

    ldap_server adds {
         url "ldaps://10.0.0.45/dc=example,dc=com?sAMAccountName?sub?";
         binddn "cn=admin,dc=example,dc=com";
         binddn_passwd "password";
         require valid_user;
         satisfy any;
    }

    server {
        listen       80;
        server_name  localhost;

        auth_ldap "Forbidden";
        auth_ldap_servers adds;

        location / {
            root   html;
            index  index.html index.htm;
        }
    }
}

It passes the configtest:

ubuntu@ip-10-0-0-171:~$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
samsonkolge commented 6 years ago

I am getting the same error. Has anybody found the answer for this yet?

samsonkolge commented 6 years ago

Looks like you have not provided proxy_pass directives?

samsonkolge commented 6 years ago

The location should probably be like the one below to get rid of the error:

location / { proxy_pass http://localhost proxy_set_header Host $host auth_ldap_servers test1; }