使用nginx的代理功能了。
1、安装Nginx:
1 |
[root@ELK /] # yum -y install nginx
|
2、安装Apache密码生产工具:
1 |
[root@ELK /] # yum install httpd-tools
|
3、生成密码文件:
1 2 |
[root@ELK /] # mkdir -p /etc/nginx/passwd
[root@ELK /] # htpasswd -b /etc/nginx/passwd/kibana.passwd user ******
|
4、配置Nginx:
1 2 |
[root@ELK /] # cp /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.backup
[root@ELK /] # vim /etc/nginx/conf.d/default.conf
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
#/etc/nginx/conf.d/default
server {
listen 192.168.75.150: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配置文件:
1 2 3 4 |
[root@ELK /] # vim /usr/local/elk/kibana/config/kibana.yml
# The host to bind the server to.
server.host: "localhost"
|
6、重启Kibana服务,配置文件生效:
1 |
[root@ELK /] # su - elk --command="/usr/local/kibana/bin/kibana serve &"
|
7、重启Nginx服务:
1 |
[root@ELK /] # service nginx restart
|