HTTP auth basic directives
auth_basic_user_file directive
http, server, location, limit_except; path to a username/password-hash file. Keep outside served content and restrict permissions.
Formal Syntax & Structure
nginx syntaxnginx
auth_basic_user_file file;Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| file | path expression | Read a protected credential-hash file outside the public document root; avoid plaintext and obsolete hash schemes. |
Working Example
Example Snippetnginx
auth_basic_user_file /path/to/approved-password-file;