nginx设置访问密码
2019-09-11通过htpasswd命令创建密码文件。
1、yum install httpd-tools
2、创建htpasswd.users,配置Nginx
htpasswd -c conf/htpasswd.users test 123456
htpasswd.users
 user01:adfjalsjdfsd
3、vi /usr/local/nginx/conf/nginx.conf
 server {
 listen 8088;
 root /data/deploy/www;
 index index.php index.html index.cgi;
 location /nagios{
 auth_basic "  online chat system";
 auth_basic_user_file /usr/local/nagios/etc/htpasswd.users;
4、增加一个用户test1
htpasswd -b conf/htpasswd.users test1 123456