HTTP auth basic directives

auth_basic directive

http, server, location, limit_except; default off. Configures the Basic authentication realm; use TLS and a reviewed password file.

Formal Syntax & Structure

nginx syntaxnginx
auth_basic string | off;

Parameters & Attributes

NameTypeDescription
realmstring expression | offSet the challenge realm; off cancels inherited Basic authentication. Use HTTPS for credentials.

Working Example

Example Snippetnginx
auth_basic "Staff area";
Nginx Reference