首頁  >  文章  >  運維  >  怎麼透過Nginx反向代理實現kibana登入認證

怎麼透過Nginx反向代理實現kibana登入認證

PHPz
PHPz轉載
2023-05-12 22:01:171468瀏覽

怎麼透過Nginx反向代理實現kibana登入認證

安裝Apache Httpd 密碼產生工具

$ yum install httpd-tools -y

產生Kibana認證密碼

$ 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反向代理

在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;
}
}

設定Kibana

取消下列註解:

$ vim /usr/local/kibana/config/kibana.yml

server.host: "10.28.204.65"

重新啟動Kibana 及Nginx 服務讓設定生效

$ systemctl restart kibana.service
$ systemctl restart nginx.service

接下來瀏覽器造訪http://103.28.204.65:5601/ 會提示驗證彈窗,輸入以上產生的使用者密碼登入即可。

以上是怎麼透過Nginx反向代理實現kibana登入認證的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:yisu.com。如有侵權,請聯絡admin@php.cn刪除