Debian Codegraph @

_example/etc/experimental/nginx-access-control

raw
1 # Following directives must be included in server blocks
2 # or location blocks in order to run LL::NG access control
3
4 # Vars used by LL::NG handler
5 set $lmremote_user "";
6 set $lmlocation "";
7
8 # Apply status code computed by LL::NG handler
9 if ($lmstatus = 302) { return 302 $lmlocation; }
10 if ($lmstatus = 401) { return 401; }
11 if ($lmstatus = 403) { return 403; }
12 if ($lmstatus = 500) { return 500; }
13 if ($lmstatus = 503) { return 503; }
14
15 # Security: prevent clients from sending custom headers
16 # that could interfere with headers added by LL::NG handler
17 # For example, if LL::NG handler adds a request header "Auth-User",
18 # request header "Auth-User" sent by a malicious client would be
19 # overwritten by LL::NG handler, but "Auth_User" and "auth-user" would not,
20 # and Nginx does not permit case-sensitive header comparison.
21 # If $lmparanoid is set to 1, any suspicious request header would result in a 403 error;
22 # if set to 0, a warning will be sent in error logs;
23 # default value is 0.
24 #set $lmparanoid 1;
25