Kibana "cannot read property 'statusCodes' of undefined" when behind reverse proxy

Hey :wave:

I'm trying to access my server's kibana dashboard (that works perfectly locally) through an IIS reverse proxy with URL rewrite.

But it give me a console error:

"[warning][environment] Detected an unhandled Promise rejection. TypeError: Cannot read property 'statusCodes' of undefined"
And to the browser it sends {status code:"404","error":"Not found","message":"Not Found"}

My kibana.yml looks like this:


I Have the latest version-7.12.0

Thank you!

Hello @Dtunktolsoty

According to the docs, server.rewriteBasePath is deprecated, might be best to remove that setting - Configure Kibana | Kibana Guide [master] | Elastic

Can you share a har file of the error? Do you see errors in the kibana logs?


Hey, thanks for the fast response @mattkime
It seems that if I delete "server.rewriteBasePath" I get
"You should set server.basePath along with server.rewritebasepath" warning

an "redirected too many times" error in the browser, and end up in
"/spaces/enter" for some reason (getting no error in the console this time)

And if I delete also the server.basepath Im also getting "redirected too many times" browser error, this time without the desired subdomain (which is the subdomain of my reverse proxy)

Unfortunately, I'm behind strict company proxy, so I will not be able to share har files.

In the kibana logs, when rewritebasepath set to true, I see the promise rejection- status codes error.

It sounds to me like there's some sort of redirect loop but its difficult for me to comment on what might be happening without more information. It might be helpful to stand up a simpler service that you can access through the proxy to separate proxy problems from kibana config problems. I'm not sure if this is solely a proxy problem, a kibana config problem, or both.

Got it, Now it works!
The kibana.yml
Should look like this:

server.rewriteBasePath: false

It's seems that kibana was redirecting my requests by default to my basePath, when my reverse proxy tried to do the same. Is that makes sense?

Also, I installed requestRouter module on the IIS, but I'm sceptical that it changed something

Thanks for the help!

1 Like

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