# Kibana behind HAProxy getting 302 for "option httpchk"

**URL:** <https://discuss.elastic.co/t/kibana-behind-haproxy-getting-302-for-option-httpchk/233224>\
**Category:** Kibana\
**Created:** [May 19, 2020, 2:40am UTC](https://discuss.elastic.co/t/kibana-behind-haproxy-getting-302-for-option-httpchk/233224 "2020-05-19T02:40:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AClerk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aclerk/32/55297_2.png) [@AClerk](https://discuss.elastic.co/u/AClerk)\
**Post date:** [May 19, 2020, 2:40am UTC](https://discuss.elastic.co/t/kibana-behind-haproxy-getting-302-for-option-httpchk/233224/1 "2020-05-19T02:40:26Z")

</div>

Hey All,  
I have 2 Kibana nodes behind HAProxy.  
Trying to set the "[option httpchk](http://cbonte.github.io/haproxy-dconv/2.2/configuration.html#option%20httpchk)" 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) -

```auto
{"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?

Thanks!

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [May 19, 2020, 7:32am UTC](https://discuss.elastic.co/t/kibana-behind-haproxy-getting-302-for-option-httpchk/233224/2 "2020-05-19T07:32:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![AClerk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aclerk/32/55297_2.png) [@AClerk](https://discuss.elastic.co/u/AClerk)\
**Post date:** [May 20, 2020, 12:57am UTC](https://discuss.elastic.co/t/kibana-behind-haproxy-getting-302-for-option-httpchk/233224/3 "2020-05-20T00:57:14Z")

</div>

> [@flash1293](#):
>
> `/app/kibana` ,

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.

```auto
{"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?

Cheers!

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [May 20, 2020, 7:38am UTC](https://discuss.elastic.co/t/kibana-behind-haproxy-getting-302-for-option-httpchk/233224/4 "2020-05-20T07:38:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 17, 2020, 7:49am UTC](https://discuss.elastic.co/t/kibana-behind-haproxy-getting-302-for-option-httpchk/233224/5 "2020-06-17T07:49:32Z")

</div>

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