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
| Name | Type | Description |
|---|---|---|
| realm | string expression | off | Set the challenge realm; off cancels inherited Basic authentication. Use HTTPS for credentials. |
Working Example
Example Snippetnginx
auth_basic "Staff area";