Running Kibana behind a reverse proxy under a subpath keeps the UI reachable at a predictable URL like /kibana, without dedicating a separate hostname or port. A correct base path prevents broken navigation links, missing static assets, and API calls that accidentally target the proxy root.
Kibana generates URLs for its web interface and APIs based on the configured prefix. The server.basePath setting defines that URL prefix, while server.rewriteBasePath controls whether Kibana removes the prefix from incoming requests before routing them internally.
The base path must start with / and must not end with a slash, and changes require a restart to take effect. When server.rewriteBasePath is set to false, the reverse proxy must strip the base path before forwarding requests to Kibana, or requests that include the prefix may return 404.
Steps to configure the Kibana base path:
- Pick the URL prefix to use as the base path (for example /kibana).
server.basePath must start with / and must not end with /.
- Decide whether Kibana should rewrite incoming requests that include the base path.
Set server.rewriteBasePath to true to have Kibana strip the prefix automatically, or leave it as false when the reverse proxy rewrites the path before forwarding to Kibana.
- Set the base path settings in /etc/kibana/kibana.yml.
server.basePath: "/kibana" server.rewriteBasePath: true
- Restart the Kibana service to apply the base path.
$ sudo systemctl restart kibana
- Request the base path URL to confirm Kibana redirects into the application.
$ curl -s -I http://localhost:5601/kibana/ HTTP/1.1 302 Found location: /kibana/app/home
A 302 Found response with a location header under the chosen prefix indicates the base path is active.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
