码迷,mamicode.com
首页 > 其他好文 > 详细

Nginx的安全配置

时间:2018-09-26 22:42:55      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:简单   客户   comm   cidr   status   enc   efault   加密   out   

nginx的安全配置

Nginx_auth_basic_module 简单认证

用"http basic authentication(简单的认证)"来限制用户的访问
一般的用法

location / {
auth_basic string;
auth_basic_user_file /etc/nginx/conf.d/htpasswd;
}

Syntax:     auth_basic string | off;
Default:    auth_basic off;
Context:    http, server, location, limit_except

使用基本的‘http basic authentication‘用户名和密码验证

Syntax: auth_basic_user_file file;
Default:    —
Context:    http, server, location, limit_except

指定保存的用户和密码,格式如下

comment
name1:password1
name2:password2:comment
name3:password3

 联系我们:gaon5@hotmail.com
迷上了代码!