ES,kibana通过nginx添加访问权限
一、安装nginx
yum install epel-release -y
yum install -y nginx
二、安装Apache Httpd 密码生成工具
# 生成密码 yum install -y httpd-tools
$ mkdir -p /usr/local/nginx/conf/passwd
$ htpasswd -c -b /usr/local/nginx/conf/passwd/kibana.passwd zhanghao mima
三、配置Nginx反向代理
#查看nginx配置文件位置 nginx -t #编辑nginx vim /etc/nginx/nginx.conf
server { listen 8080; server_name 10.0.0.11; auth_basic "Restricted Access"; auth_basic_user_file /usr/local/nginx/conf/passwd/kibana.passwd; location / { proxy_pass http://0.0.0.0: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; } }
四、最后开启防火墙
#开启防火墙 systemctl start firewalld.service #添加端口 firewall-cmd --zone=public --add-port=9200/tcp --permanent firewall-cmd --zone=public --add-port=8080/tcp --permanent
#端口加入防火墙firewall-cmd --add-port=5601/tcp
关闭SeLinux:
临时关闭(不用重启机器):setenforce 0