Updated documentation and example.

Commit 06444b36f6 changed returned error
code from 403 to 401 in case of failed auth and documentaion must be
updated accordingly.
This commit is contained in:
Vladimir Homutov 2016-10-10 16:48:29 +03:00
parent 06444b36f6
commit d56a55e21e
2 changed files with 12 additions and 12 deletions

View File

@ -75,7 +75,7 @@ For detailed instructions, see [Configuring the Reference Implementation](https:
location = /auth-proxy {
proxy_pass http://<strong>127.0.0.1</strong>:8888;
proxy_cache <strong>auth_cache</strong>; # Must match the name in the proxy_cache_path directive above
proxy_cache_valid 200 403 <strong>10m</strong>;
proxy_cache_valid 200 <strong>10m</strong>;
# URL and port for connecting to the LDAP server
proxy_set_header X-Ldap-URL "<strong>ldaps</strong>://<strong>example.com</strong>:<strong>636</strong>";
@ -118,7 +118,7 @@ The **nginx-ldap-auth.conf** file enables caching of both data and credentials.
<strong>#</strong>proxy_cache auth_cache;
# note that cookie is added to cache key
<strong>#</strong>proxy_cache_key "$http_authorization$cookie_nginxauth";
<strong>#</strong>proxy_cache_valid 200 403 10m;
<strong>#</strong>proxy_cache_valid 200 10m;
}
}
}</pre>

View File

@ -22,8 +22,8 @@ http {
location / {
auth_request /auth-proxy;
# redirect 401 and 403 to login form
error_page 401 403 =200 /login;
# redirect 401 to login form
error_page 401 =200 /login;
proxy_pass http://backend/;
}
@ -47,7 +47,7 @@ http {
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_cache auth_cache;
proxy_cache_valid 200 403 10m;
proxy_cache_valid 200 10m;
# The following directive adds the cookie to the cache key
proxy_cache_key "$http_authorization$cookie_nginxauth";