Kibana behind HAProxy getting 302 for "option httpchk"

Hey All,
I have 2 Kibana nodes behind HAProxy.
Trying to set the "option httpchk" on the backend.
I am getting a 302 response?
I tried the following:

  • option httpchk GET /kibana HTTP/1.1\r\nHost:\ haproxy
  • option httpchk GET / HTTP/1.1\r\nHost:\ haproxy

With both I get the same result (from kibana stdout) -

{"type":"response","@timestamp":"2020-05-19T02:31:24Z","tags":[],"pid":60636,"method":"get","statusCode":302,"req":{"url":"/","method":"get","headers":{"host":"haproxy"},"remoteAddress":"x.x.x.x","userAgent":"x.x.x.x"},"res":{"statusCode":302,"responseTime":1,"contentLength":9},"message":"GET / 302 1ms - 9.0B"}

What are the correct configurations?
Or any other tips & tricks?


Status code 302 is indicating the route you are accessing isn't a route Kibana is commonly using to serve content, so it is trying to redirect the request.

If you didn't change any configs, the default route is /app/kibana, so you could try that.

If you have set the server.basePath setting in your yml file, you have to prepend the base path as well.

Hey @flash1293
Thanks for the reply.
I am looking for that path, that is the reason for this thread.
I am still getting 302 responses after I have changed the path.

{"type":"response","@timestamp":"2020-05-20T00:54:06Z","tags":[],"pid":60636,"method":"get","statusCode":302,"req":{"url":"/app/kibana","method":"get","headers":{"host":"haproxy"},"remoteAddress":"x.x.x.x","userAgent":"x.x.x.x"},"res":{"statusCode":302,"responseTime":4,"contentLength":9},"message":"GET /app/kibana 302 4ms - 9.0B"}

Any advise on this?


If you don't have a base path set in your kibana.yml my next guess would be /login if you have security enabled.

To simplify the search I would suggest doing the same request using curl - then you can see where Kibana tries to redirect you to.

1 Like

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