nginx用户认证配置( Basic HTTP authentication)
来源:互联网 发布:mysql存手机号 编辑:程序博客网 时间:2024/06/05 03:05
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 auth指令
语法: auth_basic string | off;
默认值: auth_basic off;
配置段: http, server, location, limit_except
默认表示不开启认证,后面如果跟上字符,这些字符会在弹窗中显示。
语法: auth_basic_user_file file;
默认值: —
配置段: http, server, location, limit_except
用户密码文件,文件内容类似如下:
nginx认证配置实例
备注:一定要注意auth_basic_user_file路径,否则会不厌其烦的出现403。
生成密码
可以使用htpasswd,或者使用openssl
账号:ttlsa
密码:123456
reload nginx
效果如下:
阅读全文
0 0
- nginx用户认证配置( Basic HTTP authentication)
- nginx用户认证配置( Basic HTTP authentication)
- nginx用户认证配置( Basic HTTP authentication)及认证原理和实现
- HTTP Basic Authentication认证
- HTTP Basic Authentication认证
- HTTP Basic Authentication认证
- HTTP Basic 认证(Authentication)
- HTTP Basic Authentication认证
- http 基础认证(Basic Authentication)
- HTTP基础认证Basic Authentication
- HTTP基本认证(Basic Authentication)
- PHP 模拟 HTTP 基本认证(Basic Authentication)
- java添加HTTP基本认证(Basic Authentication)
- Go实战--通过basic认证的http(basic authentication)
- ubuntu nginx配置HTTP Authentication
- nginx用户认证配置
- HTTP基本认证(Basic Authentication)的JAVA示例
- HTTP基本认证(Basic Authentication)的JAVA示例
- ShellExecute与ShellExecuteEx的用法
- 访问URL时传入另一个URL作为参数
- [LeetCode-Algorithms-48] "Rotate Image" (2017.11.16-WEEK11)
- Android Studio新建工程Gradle编译报错(com.android.support:appcompat-v7:16.+)
- 第10周项目2- 二叉树构造算法的验证(1)
- nginx用户认证配置( Basic HTTP authentication)
- 第八周项目3-顺序串算法
- idea使用常见问题
- 共享扫码娃娃机方案怎么做
- OutputStream基本操作
- 爬虫Scrapy-05Spider
- 使用代码实现Autolayout方法
- awk 案例
- 【云星数据---Apache Flink实战系列(精品版)】:Apache Flink批处理API详解与编程实战013--DateSet实用API详解013