1、安装Nginx:
[root@centos /]# yum -y install nginx
2、安装Apache密码生产工具:
[root@centos /]# yum install httpd-tools
3、生成密码文件:
[root@centos /]# mkdir -p /etc/nginx/passwd
[root@centos /]# htpasswd -c -b /etc/nginx/passwd/kibana.passwd user ******
4、配置Nginx:
[root@centos /]# cp /etc/nginx/nginx.conf /etc/nginx/conf.d/kibana.conf
[root@centos /]# vim /etc/nginx/conf.d/kibana.conf
#/etc/nginx/conf.d/kibana
server {
listen 10.168.1.226:5601;
auth_basic "Kibana Auth";
auth_basic_user_file /etc/nginx/passwd/kibana.passwd;
location / {
proxy_pass http://127.0.0.1:5601;
proxy_redirect off;
}
}
5、修改Kibana配置文件:
[root@centos /]# vim /etc/kibana/kibana.yml
server.host: “localhost”
6、重启Kibana服务,配置文件生效:
[root@centos /]# service kibana restart
7、重启Nginx服务:
[root@centos /]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@centos /]# service nginx restart
8.页面如下
输入用户名密码