kibana增加验证

Kibana从5.5开始不提供认证功能,想用官方的认证X-Pack收费 ...

自己动手吧,用nginx的代理加apache生成的密码认证文件。
环境:ubuntu16.04

安装nginx
apt-get install nginx

增加kibana的nginx配置文件
cat /etc/nginx/sites-enabled/kibana.conf
server {
listen 8080;
server_name 内网IP;

auth_basic "Restricted Access";
auth_basic_user_file /etc/nginx/kibana_htpasswd.users;
location / {
proxy_pass http://127.0.0.1:5601;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}

安装apache密码认证文件生成工具
apt-get install apache2-utils

生成验证账号和密码
htpasswd -bc /etc/nginx/kibana_htpasswd.users 账号 密码

测试nginx配置是否正确
nginx -t
重新加载nginx配置
nginx -s reload

重启kibana
/etc/init.d/kibana restart

原文地址:https://www.cnblogs.com/ddif/p/9229124.html