RuHttpAuthBasicModule
Contents |
[edit] ngx_http_auth_basic_module
袦芯写褍谢褜 ngx_http_auth_basic_module 锌芯蟹胁芯谢褟械褌 蟹邪泻褉褘褌褜 写芯褋褌褍锌 褋 锌褉芯胁械褉泻芯泄 懈屑械薪懈 懈 锌邪褉芯谢褟 锌芯 锌褉芯褌芯泻芯谢褍 HTTP Basic Authentication. 小芯写械褉卸邪薪懈械 袩褉懈屑械褉 泻芯薪褎懈谐褍褉邪褑懈懈
[edit] 袛懈褉械泻褌懈胁褘
- [#auth_basic auth_basic]
- [#auth_basic_user_file auth_basic_user_file]
袩褉懈屑械褉 泻芯薪褎懈谐褍褉邪褑懈懈
: location / { : auth_basic "closed site"; : auth_basic_user_file conf/htpasswd; : }
[edit] auth_basic
syntax: auth_basic [褋褌褉芯泻邪|off]
default: auth_basic off
context: http, server, location, limit_except
袛懈褉械泻褌懈胁邪 胁泻谢褞褔邪械褌 锌褉芯胁械褉泻褍 懈屑械薪懈 懈 锌邪褉芯谢褟 锌芯 锌褉芯褌芯泻芯谢褍 HTTP Basic Authentication. 袟邪写邪薪薪褘泄 锌邪褉邪屑械褌褉 懈褋锌芯谢褜蟹褍械褌褋褟 胁 泻邪褔械褋褌胁械 realm. 袩邪褉邪屑械褌褉 "off" 锌芯蟹胁芯谢褟械褌 芯褌屑械薪懈褌褜 写械泄褋褌胁懈械 褍薪邪褋谢械写芯胁邪薪薪芯泄 褋 薪懈卸械谢械卸邪褖械谐芯 褍褉芯胁薪褟 写懈褉械泻褌懈胁褘.
[edit] auth_basic_user_file
syntax: auth_basic_user_file 褎邪泄谢
default: 薪械褌
context: http, server, location, limit_except
袛懈褉械泻褌懈胁邪 蟹邪写邪褢褌 褎邪泄谢, 胁 泻芯褌芯褉芯屑 褏褉邪薪褟褌褋褟 懈屑械薪邪 懈 锌邪褉芯谢懈 锌芯谢褜蟹芯胁邪褌械谢械泄. 肖芯褉屑邪褌 褎邪泄谢邪 褋谢械写褍褞褖懈泄:
: # 泻芯屑屑械薪褌邪褉懈泄 : 懈屑褟1:锌邪褉芯谢褜1 : 懈屑褟2:锌邪褉芯谢褜2:泻芯屑屑械薪褌邪褉懈泄 : 懈屑褟3:锌邪褉芯谢褜3
袩邪褉芯谢懈 写芯谢卸薪褘 斜褘褌褜 蟹邪褕懈褎褉芯胁邪薪褘 褎褍薪泻褑懈械泄 crypt(3). 袛谢褟 褋芯蟹写邪薪懈褟 褎邪泄谢邪 褋 锌邪褉芯谢褟屑懈 屑芯卸薪芯 胁芯褋锌芯谢褜蟹芯胁邪褌褜褋褟 锌褉芯谐褉邪屑屑芯泄 htpasswd 懈蟹 写懈褋褌褉懈斜褍褌懈胁邪 Apache.