1. 安装工具:sudo yum install httpd-tools

  2. 添加Nginx配置:

    1
    2
    3
    
    auth_basic "The Kibana Monitor Center";
    auth_basic_user_file /usr/local/nginx/html/.htpasswd;
           
    

  3. 创建用户:sudo htpasswd -c /usr/local/nginx/html/.htpasswd admin