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:

http://tfvs0755:5601/app/home

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 www.mydomain.com/apps/kibana.
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.host: "tfvs0755.mydomain.net"

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

server.rewriteBasePath: false

server.publicBaseUrl: "http://tfvs0755.mydomain.net:5601/apps/dashboards/kibana"

elasticsearch.hosts: ["http://tfvs0754.mydomain.net:9200"]

Nginx Configuration

server {
    #listen 80;
    listen 0.0.0.0:80;

    server_name tfvs0755.mydomain.net;

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

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

    location / {
        #proxy_pass http://127.0.0.1:5601;
        proxy_password http://10.140.220.163:5601;
        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 http://tfvs0755.mydomain.net/apps/dashboards/kibana 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):

Nice!

Now work fine!!

Thanks!!!!

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