繁体   English   中英

Kibana 仪表板无法与 Nginx 连接

[英]Kibana dashboard couldn't connect with Nginx

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

Kibana 和 Nginx 在本地运行并安装在安装在 C:\\

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 仪表板。

谢谢

更改“server_name 127.0.0.1:5601;” 到“服务器名称本地主机:80;”

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

upstream kibana {
    server localhost:5601;
}

然后将“位置〜”替换为:

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

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

我已经将我的 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;        
    }
}

以下是如何使用 letencrypt 通过远程服务器上的 nginx kibana 和 ES 代理到 kibana 并使用 https

        server {
        listen [some_port] ssl http2;
        server_name [server_name];
        root /your/root/directoty;

        location /app {
        auth_basic "Restricted";
        auth_basic_user_file /etc/nginx/conf.d/yyyyyyyyy.passwd;
        proxy_pass http://example.com:5601;
       }


       location /bundles {
       proxy_pass  http://example.com:5601/bundles;
       }
       location /elasticsearch {
       proxy_pass [http://elasticsearch_server:9200;]
       }
       location /status {
       proxy_pass  http://example.com:5601/status;
       }
       location /api {
       proxy_pass  http://example.com:5601/api;
       }

       location /plugins {
       proxy_pass  http://example.com:5601/plugins;
       }


       location /ui {
       proxy_pass  http://example.com:5601/ui;
       }

       location /es_admin {
       proxy_pass  http://example.com:5601/es_admin;
       }

       location /built_assets {
         proxy_pass http://example.com:5601/built_assets;
       }

       location /node_modules {
         proxy_pass http://example.com:5601/node_modules;
       }

       location /translations {
         proxy_pass http://example.com:5601/translations;

       }

      location /internal {
        proxy_pass http://example.com:5601/internal;
      }   

     ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
     ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
     ssl_trusted_certificate /etc/letsencrypt/live/yourdomain.com/chain.pem;
     include snippets/ssl.conf;
     include snippets/letsencrypt.conf;

     access_log /var/log/nginx/xxxx.access.log;
     error_log /var/log/nginx/xxxxx.error.log;


     passenger_enabled on;
     passenger_min_instances 1;
     client_max_body_size 10m;

}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM