编辑kibana的配置文件,对 server.basePath
进行定义,配置路径。
cat /etc/kibana/kibana.yml
Default Kibana configuration for docker target
server.name: kibana
server.host: "0"
server.basePath: "/elk"
elasticsearch.hosts: [ "http://elasticsearch:9200" ]
xpack.monitoring.ui.container.elasticsearch.enabled: true
i18n.locale: "zh-CN"
systemctl restart kibana
netstat -nltp |grep 5601
tcp 0 0 127.0.0.1:5601 0.0.0.0:* LISTEN 72068/node
编写一个代理配置文件
cat /etc/nginx/conf.d/proxy_kibana.conf
server {
listen 80;
server_name 172.24.115.4;
location /elk/ {
proxy_pass http://172.24.115.45:5601;
rewrite ^/elk/(.*)$ /$1 break;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
}
}
最终访问 http://172.24.115.4/elk
便可以访问到代理的kibana,这里由于配置了别的IP转发至该IP,故不贴图了。
Original: https://www.cnblogs.com/yanjieli/p/13573781.html
Author: 别来无恙-
Title: Nginx代理kibana方法2
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/543599/
转载文章受原作者版权保护。转载请注明原作者出处!