Nginx的安全配置

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

Ctrl+Enter 发布

发布

取消

猜你喜欢

转载自blog.51cto.com/13447608/2286311