# How to put Kibana 5.4.1 behind Apache proxy

**URL:** https://discuss.elastic.co/t/how-to-put-kibana-5-4-1-behind-apache-proxy/89927
**Category:** Kibana
**Created:** [June 19, 2017, 12:24pm UTC](https://discuss.elastic.co/t/how-to-put-kibana-5-4-1-behind-apache-proxy/89927 "2017-06-19T12:24:07Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![ppseal](https://avatars.discourse-cdn.com/v4/letter/p/d9b06d/32.png) [@ppseal](https://discuss.elastic.co/u/ppseal)
#### Post date: [June 19, 2017, 12:24pm UTC](https://discuss.elastic.co/t/how-to-put-kibana-5-4-1-behind-apache-proxy/89927/1 "2017-06-19T12:24:07Z")

</div>

Hi There,

I have made the following changes but Apache is not redirecting to Kibana and Kibana is also still directly accessible via 5601 port.  
My change details below:

Added following line in kibana.yml:  
erver.basePath: "/kibana"

Added following in apache config:  
\<Location /kibana/\>  
ProxyPass [http://localhost:5601/](http://localhost:5601/)  
ProxyPassReverse [http://localhost:5601/](http://localhost:5601/)

---

<div class="post-metadata">

### Author: ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)
#### Post date: [June 19, 2017, 7:34pm UTC](https://discuss.elastic.co/t/how-to-put-kibana-5-4-1-behind-apache-proxy/89927/2 "2017-06-19T19:34:46Z")

</div>

Can you check if this post helps you?

> [@Kibana 5 behind reverse proxy](https://discuss.elastic.co/t/kibana-5-behind-reverse-proxy/75573):
>
> Is there a documentation out there describing the configuration of kibana 5 behind reverse proxy. -- Niraj

Thanks,  
Lee

---

<div class="post-metadata">

### Author: ![yodog](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yodog/32/4822_2.png) [@yodog](https://discuss.elastic.co/u/yodog)
#### Post date: [June 20, 2017, 2:15am UTC](https://discuss.elastic.co/t/how-to-put-kibana-5-4-1-behind-apache-proxy/89927/3 "2017-06-20T02:15:45Z")

</div>

> [@\[4.3.0 \] how to configure your nginx balancer and apache reverse proxy](https://discuss.elastic.co/t/4-3-0-how-to-configure-your-nginx-balancer-and-apache-reverse-proxy/37351/2):
>
> ok. got it. this is what you need for a fully functional proxy / load balancer answering on [http://my-balancer/kibana/](http://my-balancer/kibana/) #Balancer nginx /etc/nginx/conf.d/elastic-80.server.conf upstream web { server elk-node-01; server elk-node-02; server elk-node-03; keepalive 5; } server { listen 80; location / { proxy\_pass http://web; proxy\_http\_version 1.1; proxy\_set\_header Connection "Keep-Alive"; proxy\_set\_header Proxy-Connection "Keep-Alive…

---

<div class="post-metadata">

### Author: ![ppseal](https://avatars.discourse-cdn.com/v4/letter/p/d9b06d/32.png) [@ppseal](https://discuss.elastic.co/u/ppseal)
#### Post date: [June 20, 2017, 9:27am UTC](https://discuss.elastic.co/t/how-to-put-kibana-5-4-1-behind-apache-proxy/89927/4 "2017-06-20T09:27:53Z")

</div>

Thanks LeeDr!

That worked. However, Kibana is still accessible via the original Kibana URL i.e. ip:5601.

How do I stop that? The purpose to put behind a proxy is security , if Kibana stays directly accessible that'll be of no use. Appreciate any help.

Tx

---

<div class="post-metadata">

### Author: ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)
#### Post date: [June 20, 2017, 6:01pm UTC](https://discuss.elastic.co/t/how-to-put-kibana-5-4-1-behind-apache-proxy/89927/5 "2017-06-20T18:01:45Z")

</div>

In your kibana.yml do you have this?

`#server.host: "localhost"`

That's the default value. That means Kibana will only listen on localhost. That also means you can reach it using [http://localhost:5601](http://localhost:5601) but only on that machine. And the proxy has to be able to reach Kibana so it has to listen on some IP. But only the proxy should be reachable from a connection on another machine.

If you've set `server.host` to some other value, like the IP address of the machine, or 0.0.0.0, then it will be reachable from another machine.

---

<div class="post-metadata">

### Author: ![ppseal](https://avatars.discourse-cdn.com/v4/letter/p/d9b06d/32.png) [@ppseal](https://discuss.elastic.co/u/ppseal)
#### Post date: [June 24, 2017, 8:53am UTC](https://discuss.elastic.co/t/how-to-put-kibana-5-4-1-behind-apache-proxy/89927/6 "2017-06-24T08:53:32Z")

</div>

Great! Thanks LeeDr.

---

<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: [July 22, 2017, 8:53am UTC](https://discuss.elastic.co/t/how-to-put-kibana-5-4-1-behind-apache-proxy/89927/7 "2017-07-22T08:53:43Z")

</div>

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