zoukankan      html  css  js  c++  java
  • ELK快速入门(五)配置nginx代理kibana

    ELK快速入门五-配置nginx代理kibana

    由于kibana界面默认没有安全认证界面,为了保证安全,通过nginx进行代理并设置访问认证。

    配置kibana

    [root@linux-elk1 ~]# vim /etc/kibana/kibana.yml
    server.host: "127.0.0.1"    #将监听地址更改为127.0.0.1
    [root@linux-elk1 ~]# systemctl restart kibana
    [root@linux-elk1 ~]# netstat -nlutp |grep 5601
    tcp        0      0 127.0.0.1:5601          0.0.0.0:*               LISTEN      72068/node

    部署nginx

    1)安装nginx

    [root@linux-elk1 ~]# yum -y install nginx httpd-tools

    2)配置nginx

    [root@linux-elk1 ~]# vim /etc/nginx/conf.d/kibana.conf
    upstream kibana_server {
        server 127.0.0.1:5601 weight=1 max_fails=3 fail_timeout=60;
    }
    
    server {
        listen 80;
        server_name www.kibana.com;
        auth_basic "Restricted Access";
        auth_basic_user_file /etc/nginx/conf.d/htpasswd.users;
        location / {
            proxy_pass http://kibana_server;
            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;
        }
    }
    
    [root@linux-elk1 ~]# htpasswd -bc /etc/nginx/conf.d/htpasswd.users admin 123456
    Adding password for user admin
    [root@linux-elk1 ~]# cat /etc/nginx/conf.d/htpasswd.users
    admin:$apr1$ro5tQZp9$grhByziZtm3ZpZCsSFzsQ1
    [root@linux-elk1 ~]# systemctl start nginx

    3)windows上添加hosts, 路径C:WindowsSystem32driversetchosts

    192.168.1.31    www.kibana.com

    4)测试验证

  • 相关阅读:
    JS面向(基于)对象编程--构造方法(函数)
    一个超简单的马里奥游戏
    JavaScript基于对象编程
    JavaScript基础之函数与数组
    Learn CSS
    The first day of HTML
    mysql cmd 无法登录
    datagrid 扩展 页脚 合计功能
    this高级应用
    (xxx.55).toFixed(1) 无法正确进位处理
  • 原文地址:https://www.cnblogs.com/yanjieli/p/11187689.html
Copyright © 2011-2022 走看看