February 2018
Beginner to intermediate
348 pages
9h 40m
English
The auth_request module was implemented in recent versions of Nginx and allows you to allow or deny access to a resource based on the result of a sub-request. Nginx calls the URI that you specify via the auth_request directive: if the sub-request returns a 2xx response code (such as HTTP/200 OK), access is allowed. If the sub-request returns a 401 or 403 status code, access is denied, and Nginx forwards the response code to the client. Should the backend return any other response code, Nginx will consider it to be an error and deny access to the resource:
location /downloads/ { # if the script below returns a 200 status code, # the download is authorized auth_request /authorization.php; }
Additionally, the module offers a ...
Read now
Unlock full access