# Kibana via nginx proxy

**URL:** <https://discuss.elastic.co/t/kibana-via-nginx-proxy/103920>\
**Category:** Kibana\
**Created:** [October 13, 2017, 3:02pm UTC](https://discuss.elastic.co/t/kibana-via-nginx-proxy/103920 "2017-10-13T15:02:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![artem2017](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@artem2017](https://discuss.elastic.co/u/artem2017)\
**Post date:** [October 13, 2017, 3:02pm UTC](https://discuss.elastic.co/t/kibana-via-nginx-proxy/103920/1 "2017-10-13T15:02:47Z")

</div>

Hello, i have ELK stack in one container and it's working (accessible via container port).  
I wanna set up access to kibana interface via nginx (proxy\_pass directive), but when i enter url, i've got the followong error message: Kibana did not load properly. Check the server output for more information.

# Here is my nginx config (truncated):

#Kibana

upstream kibana {  
server 127.0.0.1:5601;

```
keepalive 4096;

```

}

location /kibana/ {  
proxy\_set\_header Host $host;  
proxy\_set\_header X-Forwarded-Proto $scheme;  
proxy\_set\_header X-Forwarded-Port $server\_port;  
proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
proxy\_pass [http://kibana/app/kibana;](http://kibana/app/kibana;)  
proxy\_http\_version 1.1;  
proxy\_set\_header Upgrade $http\_upgrade;  
proxy\_set\_header Connection $connection\_upgrade;  
proxy\_read\_timeout 900s;  
}

Please help.

---

<div class="post-metadata">

**Author:** ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)\
**Post date:** [October 13, 2017, 5:13pm UTC](https://discuss.elastic.co/t/kibana-via-nginx-proxy/103920/2 "2017-10-13T17:13:10Z")

</div>

Have you configured the `server.basePath` setting in kibana.yml? [https://www.elastic.co/guide/en/kibana/current/settings.html](https://www.elastic.co/guide/en/kibana/current/settings.html)

---

<div class="post-metadata">

**Author:** ![artem2017](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@artem2017](https://discuss.elastic.co/u/artem2017)\
**Post date:** [October 16, 2017, 10:17am UTC](https://discuss.elastic.co/t/kibana-via-nginx-proxy/103920/3 "2017-10-16T10:17:48Z")

</div>

Hello, thanks for the reply.  
No, server.basePath isn't set. I've tryed to set it like /opt or /opt/kibana (location of kibana base directory in the container fs), but if it's set - kibana process always fails without logs. . .

---

<div class="post-metadata">

**Author:** ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)\
**Post date:** [October 18, 2017, 10:13am UTC](https://discuss.elastic.co/t/kibana-via-nginx-proxy/103920/4 "2017-10-18T10:13:00Z")

</div>

`server.basePath` should be set to the path kibana lives under in your nginx proxy. It looks like you have nginx configured to use `/kibana/` so `server.basePath` should also be `/kibana/`. Can't remember for sure if you need to include the slashes or not. Also, when nginx forwards the request to kibana it needs to remove that `/kibana/` portion first.

---

<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:** [November 15, 2017, 10:13am UTC](https://discuss.elastic.co/t/kibana-via-nginx-proxy/103920/5 "2017-11-15T10:13:24Z")

</div>

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