Hello,
I have researched a lot of posts about configuring Kibana 5 behind Nginx, but I am not able to achieve it. I am trying to set up like this : http://myhost/kibana to work.
and also set server.basePath = "/kibana" in kibana.yml file.
But even then, the links on the left sidebar does not show the updated path. Instead of showing http://myhost/kibana/app/monitoring, it still shows http://myhost/app/monitoring.
If I manually access the URL I am able to view but the links on the left sidebar does not get updated.
The links in the JS are not updated. Anyone faced similar issue ?
Hrm, that's strange. I'm no expert in nginx, but that config looks right. Kibana loads, so that's probably fine.
The server.basePath setting should be all it takes to get this working. The incorrect links in the app make me thing that the setting isn't being loaded. Did you restart Kibana after you added that setting? And are you sure you're editing the right kibana.yml file, or putting it in the right location?
Yea I was editing the right file and I restarted Kibana. Still the links aren't updated. Also some of the icons for each of the links on left sidebar is gone.
Can you inspect them and see what the URLs it's trying to load for those images are? That's pretty weird, and could be an indication that there's a routing issue.
I just happened to get this working after quite a lot of effort so here it is to save other's some time. I haven't tested it extensively so ymmv. Make sure to set your server.basepath to /kibana in the kibana config.
# Exact URI match to load the base kibana page without a redirect
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;
proxy_cache_bypass $http_upgrade;
}
# Catch for all other kibana resources. Removes proxy URI before passing on
location /kibana {
rewrite ^/kibana/(.*)$ /$1 break;
proxy_pass http://127.0.0.1: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;
}
# Catch for a stray kibana call that doesn't properly prepend the proxy URI
location /api {
if ($http_referer ~ "^.*/kibana") {
proxy_pass http://127.0.0.1:5601;
}
}
Nikhanj, if you are still having that issue, make sure that when you restarted Kibana, the front-end code bundles were reoptimized successfully. Setting a server.basePath in config requires the front-end code to be reoptimized.
Try removing your optimize/bundles directory in the Kibana install path, and restarting Kibana. As it starts up, check that you aren't running into any file permission problems.
Hi Bryanm,
Thanks for your config. I used a smaller version of it
location / {
rewrite ^/kibana/(.*)$ /$1 break;
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;
}
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.