# Kibana behind apache reverse proxy with different paths?

**URL:** <https://discuss.elastic.co/t/kibana-behind-apache-reverse-proxy-with-different-paths/178584>\
**Category:** Kibana\
**Created:** [April 26, 2019, 8:19am UTC](https://discuss.elastic.co/t/kibana-behind-apache-reverse-proxy-with-different-paths/178584 "2019-04-26T08:19:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [April 26, 2019, 8:19am UTC](https://discuss.elastic.co/t/kibana-behind-apache-reverse-proxy-with-different-paths/178584/1 "2019-04-26T08:19:20Z")

</div>

Hi,

I am struggling a while for now, so hopefully you can open my eyes and point me into the right direction.

I am running multiple kibana instances (for different clusters) in docker and also I am running a single httpd server in docker, which I want to use as reverse proxy.  
The httpd config shown below is loaded into the virtual host of httpd config.

I got it running when kibana's server.basePath is identically to the directory which apache is proxying with following configuration:

httpd:

```
Redirect /kibana /kibana/
ProxyPass /kibana/ http://kibana-poc-test:5601/kibana/
ProxyPassReverse /kibana/ http://kibana-poc-test:5601/kibana/

```

kibana:

```
server.port: 5601
server.host: "0"
server.basePath: "/kibana"
server.rewriteBasePath: true

```

Fine so far. But to keep configuration changes between my clusters as low as possible, I would prefer to run kibana in it's container at root path or at a fixed value (e.g. kibana), regardless which cluster it belongs to.

When I just change kibana to

```
server.basePath: ""
server.rewriteBasePath: false

```

and httpd to

```
Redirect /kibana /kibana/
ProxyPass /kibana/ http://kibana-poc-test:5601/
ProxyPassReverse /kibana/ http://kibana-poc-test:5601/

```

kibana UI does not load.  
Dev-Console in Browser shows:

GET [http://qdetju/bundles/app/space\_selector/bootstrap.js](http://qdetju/bundles/app/space_selector/bootstrap.js) net::ERR\_ABORTED 404 (Not Found)

-\> so the path is not added.

Where is my mistake?  
I need a solution for kibana in versions: 6.4 - 7.0.

Thanks a lot, Andreas

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [April 26, 2019, 3:11pm UTC](https://discuss.elastic.co/t/kibana-behind-apache-reverse-proxy-with-different-paths/178584/2 "2019-04-26T15:11:19Z")

</div>

Hey @asp when you're running Kibana behind a reverse-proxy which specifies a path other than the root, you have to configure the `server.basePath` variable in the `kibana.yml`. This allows Kibana to render out HTML with a `<script>` tag which has the src of `http://qdetju/${yourBasePathHere}/bundles/app/space_selector/bootstrap.js` as opposed to just `http://qdetju/bundles/app/space_selector/bootstrap.js`

---

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [April 29, 2019, 8:15am UTC](https://discuss.elastic.co/t/kibana-behind-apache-reverse-proxy-with-different-paths/178584/3 "2019-04-29T08:15:50Z")

</div>

Thanks, using the same folder name on apache proxy on external side and on base path it works as described.

So my question is, do I always the exactly same base path in apache proxy on outside and on routing target? Is no configuration possible (maybe in apache) where I can make kibana available on the **outside** by **[https://myserver/kibana\_cluster\_A](https://myserver/kibana_cluster_A)** and to proxy it to a docker container named kib\_cluster\_a where kibana is listening on [http://0.0.0.0:5601/](http://0.0.0.0:5601/) (at root in container)?

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [April 29, 2019, 2:28pm UTC](https://discuss.elastic.co/t/kibana-behind-apache-reverse-proxy-with-different-paths/178584/4 "2019-04-29T14:28:10Z")

</div>

> Is no configuration possible (maybe in apache) where I can make kibana available on the **outside** by **[https://myserver/kibana\_cluster\_A](https://myserver/kibana_cluster_A)** and to proxy it to a docker container named kib\_cluster\_a where kibana is listening on [http://0.0.0.0:5601/](http://0.0.0.0:5601/) (at root in container)?

Correct, you have to use the basePath setting in this situation.

---

<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:** [May 27, 2019, 2:28pm UTC](https://discuss.elastic.co/t/kibana-behind-apache-reverse-proxy-with-different-paths/178584/5 "2019-05-27T14:28:21Z")

</div>

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