Auth Basic#
Allows limiting access to resources by validating the user name and password using the "HTTP Basic Authentication" protocol.
Access can also be limited by address or by the
result of subrequest. Simultaneous limitation of
access by address and by password is controlled by the satisfy directive. Enables validation of user name and password using the "HTTP Basic Authentication" protocol. The specified parameter is used as a realm. Parameter value can contain variables. cancels the effect of the auth_basic directive inherited from the previous configuration level Specifies a file that keeps user names and passwords, in the following format: # comment The file name can contain variables. The following password types are supported: encrypted with the crypt() function; can be generated using the hashed with the Apache variant of the MD5-based password algorithm (apr1); can be generated with the same tools; specified by the "{scheme}data" syntax as described in RFC 2307; currently implemented schemes include PLAIN (an example one, should not be used), SHA (plain SHA-1 hashing, should not be used) and SSHA (salted SHA-1 hashing, used by some software packages, notably OpenLDAP and Dovecot). Caution Support for SHA scheme was added only to aid in migration from other web servers. It should not be used for new passwords, since unsalted SHA-1 hashing that it employs is vulnerable to rainbow table attacks.Configuration Example#
location / {
auth_basic "closed site";
auth_basic_user_file conf/htpasswd;
}
Directives#
auth_basic#
off
auth_basic_user_file#
name1:password1
name2:password2:comment
name3:password3htpasswd
utility from the Apache HTTP Server distribution or the "openssl passwd" command;