500 Internal Server Error
Howard-Chang opened this issue · 1 comments
Howard-Chang commented
Hi, I follow this reference step by step: https://www.nginx.com/blog/nginx-plus-authenticate-users/
But when I use a web browser to access http://localhost:8081.
Is there something wrong in my nginx.conf?
nginx.conf:
error_log logs/error.log debug;
worker_processes 4;
worker_rlimit_nofile 65535;
events {
worker_connections 10240;
}
http {
proxy_cache_path cache/ keys_zone=auth_cache:10m;
upstream backend {
server 127.0.0.1:9000;
}
server {
listen 8081;
location / {
auth_request /auth-proxy;
error_page 401 =200 /login;
proxy_pass http://backend/;
}
location /login {
proxy_pass http://backend/login;
proxy_set_header X-Target $request_uri;
}
location = /auth-proxy {
internal;
proxy_pass http://127.0.0.1:8888;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_cache auth_cache;
proxy_cache_valid 200 10m;
proxy_cache_key "$http_authorization$cookie_nginxauth";
proxy_set_header X-Ldap-URL "ldap://localhost/dc=xinhua,dc=org?uid?sub?(objectClass=posixAccount)";
proxy_set_header X-Ldap-BaseDN "cn=secretary,ou=group,dc=xinhua,dc=org";
proxy_set_header X-Ldap-BindDN "cn=Manager,dc=xinhua,dc=org";
proxy_set_header X-Ldap-BindPass "mypassword";
proxy_set_header X-CookieName "nginxauth";
proxy_set_header Cookie nginxauth=$cookie_nginxauth;
}
}
}
I didn't modified nginx-ldap-auth-daemon-rh-ctl.sh and python backend-sample-app.py.
thank you in advance!
Howard-Chang commented
sorry I found the error is that I didn't run nginx-ldap-auth-daemon.py