How to configure Kibana behind nginx balancer

Hi to everyone,

I have recently configured ELK in our enterprise environment. I have configured Kibana by default, without making changes, so to access Kibana, I do it by the configured host name and port:


I have reviewed the documentation, and I already know how to configure an nginx in the ELK server so that it goes through port 80 and not 5601, and avoid adding that port every time you want to access Kibana.

Now the only thing left for me to configure is the following. All the applications that we have mounted, in front of them, have an nginx balancer, which depending on the request you make, takes you to one application server or another. What I want to know is if Kibana can be configured to be accessible from the URL for example
In the nginx balancer, you would have a location to /apps/kibana and from there send the requests to the final kibana server.

How can I implement this solution? The version of ELK that I have installed is 8.0 on Ubuntu servers.

Thank you very much in advance.

The server.basePath setting can do that: Configure Kibana | Kibana Guide [master] | Elastic

Thank you very much for the reply.

I have followed the documentation that you have added, and configured everything that I think needs to be configured to be able to access it from a different URL.

These are my settings.

Kibana configuration

server.port: 5601 ""

server.basePath: "/apps/dashboards/kibana"

server.rewriteBasePath: false

server.publicBaseUrl: ""

elasticsearch.hosts: [""]

Nginx Configuration

server {
    #listen 80;


    access_log /var/log/nginx/access.log;

    #auth_basic "Restricted access";
    #auth_basic_user_file /etc/nginx/.kibana-user;

    location / {
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header connection 'update';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_update;

Now the problem is when I try to access the URL it shows me an error on the screen:

{"statusCode":404,"error":"Not found","message":"Not found"}

What am I missing to finish configuring Kibana and access from this URL?

Thank you very much in advance

I think you are mixing up base path and "default route" -
The base path is about prepending a path prefix to all requests Kibana is doing.
The default route is the route that's opened by default if Kibana is opened without a deeplink (it's configured via advanced settings):


Now work fine!!


This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.