首页 文章

Kibana仪表板无法与Nginx连接

提问于
浏览
2

嗨,我正在尝试使用Nginx作为访问Kibana 4仪表板的反向代理 . 仪表板的位置在最新的kibana中不可用,但可以使用URL访问它 .

Kibana和Nginx在本地运行并安装在安装在C:\的Windows机器上

Kibana在localhost:5601上运行 . 我安装了NGinx并将其配置为在端口80上运行 . 我的Nginx配置文件如下所示 .

http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    server {
        listen       80;
        server_name  127.0.0.1:5601;


        location / {
            root   html;
            index  index.html index.htm;
        }


        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

       location ~ {
            proxy_pass  http://127.0.0.1:5601;
            #proxy_redirect https://kibana/;
        }
}

但是当我在浏览器中输入localhost时,我看到,

“欢迎来到nginx!

如果您看到此页面,则nginx Web服务器已成功安装并正常运行 . 需要进一步配置 .

有关在线文档和支持,请参阅nginx.org . nginx.com提供商业支持 .

感谢您使用nginx . “

Kibana工作得很好:localhost:5601 . 我是否还需要对Kibana配置文件进行任何更改?我想通过localhost:80到NGinx访问kibana仪表板 .

谢谢

2 回答

  • 0

    更改“server_name 127.0.0.1:5601;”到“server_name localhost:80;”

    在“server {”上方添加此上游:

    upstream kibana {
        server localhost:5601;
    }
    

    然后将“location~”替换为:

    location /kibana/ {
        proxy_pass http://kibana/;
    }
    

    使用http://localhost/kibana访问Kibana

  • 1

    我已将我的nginx配置为反向代理kibana-4仪表板 . 以下nginx配置为我完成了这项工作:

    server {
        listen 80;
    
        #You can add your fqdn, say example.com, if you want to in the next parameter
        server_name localhost;
    
        auth_basic off;
    
        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;        
        }
    }
    

相关问题