$ yum install httpd-tools -y
$ mkdir -p /usr/local/nginx/conf/passwd $ htpasswd -c -b /usr/local/nginx/conf/passwd/kibana.passwd Userrenwolecom GN5SKorJ Adding password for user Userrenwolecom
在Nginx配置文件中添加如下内容(或新建配置文件包含):
$ vim /usr/local/nginx/conf/nginx.conf server { listen 10.28.204.65:5601; auth_basic "Restricted Access"; auth_basic_user_file /usr/local/nginx/conf/passwd/kibana.passwd; location / { proxy_pass http://10.28.204.65: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; } }
取消下面注释:
$ vim /usr/local/kibana/config/kibana.yml server.host: "10.28.204.65"
$ systemctl restart kibana.service $ systemctl restart nginx.service
接下来浏览器访问 http://103.28.204.65:5601/ 会提示验证弹窗,输入以上生成的用户密码登录即可。
以上是怎么通过Nginx反向代理实现kibana登录认证的详细内容。更多信息请关注PHP中文网其他相关文章!