HTTP auth request directives

auth_request directive

http, server, location; default off. Delegates access to a subrequest; 2xx permits, 401/403 deny, other outcomes are errors. Optional build module since 1.5.4.

Formal Syntax & Structure

nginx syntaxnginx
auth_request uri | off;

Parameters & Attributes

NameTypeDescription
uriinternal authorization URI | offSelect a subrequest endpoint; 2xx allows, 401/403 denies, other statuses are errors. Off cancels inherited authorization.

Working Example

Example Snippetnginx
auth_request /_check;
Nginx Reference