Kibana doesn't work with Nginx after update 4.1.2 to 4.2.0

Hi,

I'm trying to update kibana to 4.2.0, so I deleted old files on kibana folder and replace for news (downloaded in: https://download.elastic.co/…/kibana/kibana-4.2.0-linux-x64…).
I change kibana.yml on /config, but I can't access to new kibana on browser.

I'm using Nginx and I obtain this: "404 Not Found"

Someone can help me solve problem? What I do wrong?

Thanks.

It's probably because the paths have changed and you'll need to update your nginx configs accordingly. It's moved to /app/kibana and /bundles.

After I use this at my nginx default:

location /kibana4/
{
proxy_pass http://localhost:5601/;
proxy_redirect http://host:5601/ /kibana4/;
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;
}

What I have to change?

Thanks for help :wink:

Try this

location ~ (/app/kibana|/bundles/|/kibana4|/status|/plugins) {
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;
rewrite /kibana4/(.*)$ /$1 break;
}

Doesn't work :confused:

This is full configuration:

server {
listen *:80;

    server_name localhost;
    auth_basic "Restricted Access";
    auth_basic_user_file /etc/nginx/htpasswd.users;

    location /
    {
        proxy_pass http://localhost:9200;
        rewrite ^/es(.*) /$1 break;
    }
    location ~ ^/es.*$
    {
        proxy_pass http://localhost:9200;
        rewrite ^/es(.*) /$1 break;
    }
    location ~ (/app/kibana|/bundles/|/kibana4|/status|/plugins)
    {
            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;
            rewrite /kibana4/(.*)$ /$1 break;
    }
   location ~ ^/kopf.*$
    {
        proxy_pass http://localhost:9200;
        proxy_read_timeout 90;
       rewrite ^/kopf(.*) /_plugin/kopf/$1 break;
    }
    location ~ ^/HQ.*$
    {
        proxy_pass http://localhost:9200;
        rewrite ^/HQ(.*) /_plugin/HQ/$1 break;
    }
    location ~ ^/marvel.*$
    {
        proxy_pass http://localhost:9200;
        rewrite ^/marvel(.*) /_plugin/marvel/$1 break;
    }

    error_page 403 /error/403.html;
    error_page 404 /error/404.html;
    error_page 405 /error/405.html;
    error_page 500 501 502 503 504 /error/5xx.html;

    location ^~ /error/
    {
        internal;
        root /var/www/default;
    }

}

try to use:
location ~ (/app/kibana|/bundles/|/kibana4|/status|/plugins|/elasticsearch/)

Doesn't work to :confused:
It can other configuration problem?
I just replace old files for news and edit kibana.yml and default file of nginx (presented here).

Somenone know whats de default page of kibana? On kibana 4.1.2 default page was index.html and location of this file was "kibana/src/public". And for kibana 4.2.0 what is the default file and location?

Hi there,

I somehow managed to get this to work, although I'm no nginx specialist, just tried some tricks here and there....
I did a location paragraph for all the different requests:

location /kibana {
    proxy_pass http://127.0.0.1:5601/app/kibana;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
}

location /bundles {
    proxy_pass http://127.0.0.1:5601/bundles;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
}

location /elasticsearch {
    proxy_pass http://127.0.0.1:5601/elasticsearch;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
}
location /plugins {
    proxy_pass http://127.0.0.1:5601/plugins;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
}
location /app/ {
    proxy_pass http://127.0.0.1:5601/app/;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
}

This way I kinda made it work..... Perhaps this can be made smaller in a way...

This way I can call kibana by simply appending /kibana to my server URL.

Hope to help,
Thorsten

1 Like

So, none gave a solution. There is a workaround which is the one posted by @Thorsten_Nickel but there is no official solution to this. @jiangrzh and @PSi_AU propose the location ~(/app/kibana|/bundles/|/kibana4|/status|/plugins) fix but that's not a solution because we want to keep kibana on a different path, like my_host.com/kibana instead of my_host.com

I'm also looking for a solution. Anything new?

Nothing until now. I'm trying reinstall full stack to see if works.

Thanks Thorsten_Nickel for your help, really it works.
Here is my full configuration of nginx default file (I'm using kibana, elasticsearch, kopf and Elastic HQ):

server
{
listen 80;
server_name localhost;
auth_basic "Restricted Access";
auth_basic_user_file /etc/nginx/htpasswd.users;

    location /
    {
        proxy_pass http://localhost:9200;
        rewrite ^/es(.*) /$1 break;
    }

    location ~ ^/es.*$
    {
        proxy_pass http://localhost:9200;
        rewrite ^/es(.*) /$1 break;
    }

    location /kibana 
{
        proxy_pass http://127.0.0.1:5601/app/kibana;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
}

location /bundles 
{
           proxy_pass http://127.0.0.1:5601/bundles;
         proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
}

location /elasticsearch 
{
        proxy_pass http://127.0.0.1:5601/elasticsearch;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
}

location /elasticsearch 
{
        proxy_pass http://127.0.0.1:5601/elasticsearch;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
}

location /plugins 
{
        proxy_pass http://127.0.0.1:5601/plugins;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
}

location /app/ 
{
        proxy_pass http://127.0.0.1:5601/app/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
}

 location ~ ^/kopf.*$
    {
        proxy_pass http://localhost:9200;
        proxy_read_timeout 90;
        rewrite ^/kopf(.*) /_plugin/kopf/$1 break;
    }

    location ~ ^/hq.*$
    {
        proxy_pass http://localhost:9200;
        rewrite ^/hq(.*) /_plugin/hq/$1 break;
    }

    error_page 403 /error/403.html;
    error_page 404 /error/404.html;
    error_page 405 /error/405.html;
    error_page 500 501 502 503 504 /error/5xx.html;

    location ^~ /error/
    {
        internal;
        root /var/www/default;
    }

}

With this configuration we have a problem: status doesn't work.
Have you have an idea to solve this?

For later reference, this way we both have the config with nginx got to work, so maybe this will help anyone looking out...

Hi,

for reference, here the complete nginx config for all the locations I have seperated out, maybe something is missing ...

    location /kibana {
        proxy_pass http://127.0.0.1:5601/app/kibana;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
    }
    location /marvel {
        proxy_pass http://127.0.0.1:5601/marvel;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
    }
    location /bundles {
        proxy_pass http://127.0.0.1:5601/bundles;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
    }
    location /elasticsearch {
        proxy_pass http://127.0.0.1:5601/elasticsearch;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
    }
    location /plugins {
        proxy_pass http://127.0.0.1:5601/plugins;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
    }
    location /app/ {
        proxy_pass http://127.0.0.1:5601/app/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
    }
    location /status/ {
        proxy_pass http://127.0.0.1:5601/status;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
    }
    location /api/status/ {
        proxy_pass http://127.0.0.1:5601/api/status;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
    }
    location /#/ {
        proxy_pass http://127.0.0.1:5601/app/kibana#/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
    }

Kind regards,
Thorsten

1 Like

I have problems with the proxy redirection from apache, the kibana hang out that waiting indefinitely but i see the kibana screen.

My config:

ProxyPass http://localhost:5601/app/kibana
ProxyPassReverse http://localhost:5601/app/kibana
Order Deny,Allow
Deny from all
Allow from ********
AuthType Basic
AuthUserFile /etc/okn/htpasswd
Require valid-user
AuthName "****"

Above changes are for NGINX only. For Apache have a look at the redirected locations, those are the ones you have to add the ProxyPassRevers for.

Kind regards,
Thorsten

1 Like

But my problems are with the kibana 4.2 the kibana 4.1 works great, that version 4.2 change de route / for /app/kibana.

But you need to have defined route /

My example:

server
{
listen 80;
server_name 127.0.0.1;
auth_basic "Restricted Access";
auth_basic_user_file /etc/nginx/htpasswd.users;

    location /
    {
        proxy_pass http://127.0.0.1:9200;
        rewrite ^/es(.*) /$1 break;
    }

    location /kibana
    {
        proxy_pass http://127.0.0.1:5601/app/kibana;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
    }

location /bundles
    {
        proxy_pass http://127.0.0.1:5601/bundles;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
    }

    location /elasticsearch
    {
        proxy_pass http://127.0.0.1:5601/elasticsearch;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
    }

location /plugins
    {
        proxy_pass http://127.0.0.1:5601/plugins;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
    }

    location /app/
    {
        proxy_pass http://127.0.0.1:5601/app/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
    }

 location /status/
    {
        proxy_pass http://127.0.0.1:5601/status;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
    }

    location /api/status/
    {
        proxy_pass http://127.0.0.1:5601/api/status;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
    }

    location /#/
    {
        proxy_pass http://127.0.0.1:5601/app/kibana#/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
    }
    error_page 403 /error/403.html;
    error_page 404 /error/404.html;
    error_page 405 /error/405.html;
    error_page 500 501 502 503 504 /error/5xx.html;

location ^~ /error/
    {
        internal;
        root /var/www/default;
    }

}

HI, here's my simple ngnix config which worked with Kibana 4.1.2 and works with 4.2.0 equally with no modification.

    listen 80;
    server_name kibana;


    error_log   /var/log/nginx/kibana.error.log;
        access_log  /var/log/nginx/kibana.access.log;



     location / {
        rewrite ^/(.*) /$1 break;
        proxy_ignore_client_abort on;
        proxy_pass http://localhost:5601;
        proxy_set_header  X-Real-IP  $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header  Host $http_host;
       
        }
}

Well i solved my problems with the following apache configuration:

Timeout 3200
ProxyTimeout 3200

ProxyRequests Off
ProxyPreserveHost On

Redirect /goknlogs /app/kibana

Redirect /goknels /elasticsearch

ProxyPass /status http://:5601/status
ProxyPassReverse /status http://
****:5601/status

ProxyPass /api/status http://******:5601/api/status
ProxyPassReverse /api/status http://******:5601/api/status

ProxyPass /app/kibana http://**:5601/app/kibana
ProxyPassReverse /app/kibana http://
:5601/app/kibana

ProxyPass /app/marvel http://:5601/app/marvel
ProxyPassReverse /app/marvel http://
***:5601/app/marvel

ProxyPass /api/marvel http://:5601/api/marvel
ProxyPassReverse /api/marvel http://
:5601/api/marvel

ProxyPass /bundles http://:5601/bundles
ProxyPassReverse /bundles http://
:5601/bundles

ProxyPass /elasticsearch http://************:9200
ProxyPassReverse /elasticsearch http://************:9200

<Proxy http://******:5601/>
Order Deny,Allow
Deny from all
Allow from ******
AuthType Basic
AuthName " log Server"
AuthUserFile /etc/
/htpasswd.controlusers
Require valid-user

<Proxy http://*:9200/>
Order Deny,Allow
Deny from all
Allow from ********
AuthType Basic
AuthName " ELS Server"
AuthUserFile /etc/
/htpasswd.controlusers
Require valid-user

Works great!!!!!! i hope help the people

1 Like