App/kibana missing in some links - behind nginx proxy

When I setup Kibana (7.4.2) behind a proxy some of the links are missing the app/kibana part.

So i'll just see something like this:

/#/management/security/users

as opposed to how it should be

/app/kibana#/management/security/users

This makes it unusable when using workspaces. Has anyone run into this?

I noticed top level links work (.e.g /app/kibana#/managemenent) but second level ones (e.g. /../management/security/users ) don't. They look like /#/management/security/users.

I see in the code kbnBaseUrl:/app/kibana but the sublinks aren't using it for some reason.

I noticed the primary links (e.g. the link to visualizations) are full urls whereas the secondary links (e.g. the actual visualizations) are relative links. It seems they use the react euLink directive. Maybe these directives have some problem with proxies? I'm not sure how a proxy could affect it.

What does your nginx config look like? If you're mounting to a path, you will want to set server.basePath in your kibana.yml to be the same as that path.

Yes so server.basePath is /kibana in my kibana.yml
and then the nginx config location block is /kibana
Everything is working except the "sub" links that are in the main page that seem to be managed by the React euiLink tag.

Also I have a rewrite statement in my nginx config so i set the server.rewriteBasePath to false cause i don't need it since i already rewrite in the nginx config.

rewrite ^/kibana/(/.*)$ $1 break;

So oddly enough the commons.bundle.js file is different based on the proxy. If there is no proxy then the file is about 4.8MB. If there is a proxy then the commons.bundle.js file is more than 7MB.

So for some reason when Kibana is behind a proxy it's pulling a different commons.bundle.js file.

What does your nginx config look like? These are static files, so it has to be something in the proxy.

Problem resolved. You're right the config wasn't quite right.

If people are using Kubernetes Ingress controller here's the key parts:

metadata:
  annotations: 
     nginx.ingress.kubernetes.io/add-base-url: "false"  <-  I had this set to true

     nginx.ingress.kubernetes.io/configuration-snippet: | 

         rewrite ^/myapp/(/.*)$ $1 break;

The rewrite is all you need. Set base url to false

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