1.创建密码

yum install httpd-tools -y
htpasswd -c /data/kibana/kibana.passwd admin
输入密码

2.新增Nginx配置文件

server {
  listen 80 ;
  server_name elk.oaroad.com;
  
  location / {
      proxy_pass http://172.24.97.126:5601$request_uri;
      auth_basic "User Authentication";
      auth_basic_user_file /data/kibana/kibana.passwd;
  }
  access_log  /www/wwwlogs/oaroad.com.log log_json;
}

3.重启Nginx

nginx -t
nginx -s reload