在HTTP中,基本认证(Basic access authentication)是一种用来允许网页浏览器或其他客户端程序在请求时提供用户名和口令形式的身份凭证的一种登录验证方式。
ngx_http_auth_basic_module
模块实现让访问着,只有输入正确的用户密码才允许访问web内容。web上的一些内容不想被其他人知道,但是又想让部分人看到。Nginx的http auth
模块以及Apache http auth
都是很好的解决方案。
默认情况下Nginx已经安装了ngx_http_auth_basic_module
模块,如果不需要这个模块,可以加上 --without-http_auth_basic_module
。
Nginx Basic HTTP authentication
Nginx的用户配置实例
loc