使用 Nginx 反向代理 Kibana 并配置访问基本认证

时间:2021-08-20 09:18:17   收藏:0   阅读:27

安装nginx

apt-get install nginx

使用openssl创建一个管理员用户,例如“admin”,可以访问Kibana Web界面

echo "admin:`openssl passwd -apr1`" | tee -a /etc/nginx/conf.d/htpasswd.users

配置nginx

vim /etc/nginx/conf.d/default.conf
server {
    listen 80;
    server_name example.com;
    auth_basic "Restricted Access";
    auth_basic_user_file /etc/nginx/conf.d/htpasswd.users;
    location / {
        proxy_pass http://localhost: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;
    }
}

检查配置并重启nginx

nginx -t
systemctl restart nginx

原文:https://www.cnblogs.com/varden/p/15164875.html

评论(0)
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!