SHARE
TWEET

Untitled

a guest Jul 19th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. http {
  2.  
  3.     server {
  4.  
  5.         location / {
  6.             # let everyone in my organization
  7.             auth_request /auth-proxy;
  8.  
  9.             location = /auth-proxy {
  10.                 # nginx auth config
  11.                 proxy_set_header X-Ldap-Template "(sAMAccountName=%(username)s)";
  12.  
  13.  
  14.             }
  15.         }
  16.  
  17.  
  18.         location /subfolder {
  19.             auth_request /auth-proxy-subfolder;
  20.  
  21.             location = /auth-proxy-subfolder {
  22.                 # nginx auth2 config for certain group
  23.                 proxy_set_header X-Ldap-Template "(&(sAMAccountName=%(username)s)(memberOf=CN=Group,OU=Users,OU=example,OU=com)(objectClass=user))";
  24.             }
  25.     }
  26. }
  27.      
  28. localhost - - [19/Jul/2019 11:06:44] using username/password from authorization header
  29. localhost - - [19/Jul/2019 11:06:44] "GET /auth-proxy-subfolder HTTP/1.0" 401 -
  30. localhost - - [19/Jul/2019 11:06:44] using username/password from authorization header
  31. localhost - - [19/Jul/2019 11:06:44] "GET /auth-proxy HTTP/1.0" 401 -
  32. localhost - auser [19/Jul/2019 11:06:50] Auth OK for user "auser"
  33. localhost - auser [19/Jul/2019 11:06:50] "GET /auth-proxy HTTP/1.0" 200 -
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top