# Can someone share nginx config for reverse proxying Kibana4.4/4,5

**URL:** https://discuss.elastic.co/t/can-someone-share-nginx-config-for-reverse-proxying-kibana4-4-4-5/46326
**Category:** Kibana
**Created:** [April 5, 2016, 5:37am UTC](https://discuss.elastic.co/t/can-someone-share-nginx-config-for-reverse-proxying-kibana4-4-4-5/46326 "2016-04-05T05:37:34Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![abhijitdeka11](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@abhijitdeka11](https://discuss.elastic.co/u/abhijitdeka11)
#### Post date: [April 5, 2016, 5:37am UTC](https://discuss.elastic.co/t/can-someone-share-nginx-config-for-reverse-proxying-kibana4-4-4-5/46326/1 "2016-04-05T05:37:35Z")

</div>

Hi,

I am struggling to make reverse proxy work with latest versions of Kibana Kibana4.4 /Kibana 4.5

This is my current setting of [nginx](http://pastebin.com/ex2Xyuak).  
My config for basepath is -

server.basepath : "/analytics"

I want to redirect all request for /analytics to kibana server. but all I am getting is 404.Please help me with some example config if anyone has done it earlier.

---

<div class="post-metadata">

### Author: ![brayndasilva](https://avatars.discourse-cdn.com/v4/letter/b/2bfe46/32.png) [@brayndasilva](https://discuss.elastic.co/u/brayndasilva)
#### Post date: [April 5, 2016, 11:48am UTC](https://discuss.elastic.co/t/can-someone-share-nginx-config-for-reverse-proxying-kibana4-4-4-5/46326/2 "2016-04-05T11:48:04Z")

</div>

```
server {
    listen 80;

    server_name ubuntuS1;

    auth_basic "Restricted Access";
    auth_basic_user_file /etc/nginx/htpasswd.users;

    location / {
        proxy_pass http://localhost:5601;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
      }
}
```

That's what I use and works just fine.

---

<div class="post-metadata">

### Author: ![abhijitdeka11](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@abhijitdeka11](https://discuss.elastic.co/u/abhijitdeka11)
#### Post date: [April 6, 2016, 4:33am UTC](https://discuss.elastic.co/t/can-someone-share-nginx-config-for-reverse-proxying-kibana4-4-4-5/46326/3 "2016-04-06T04:33:51Z")

</div>

@brayndasilva this used to work for 4.1 but ever since Kibana has moved to "/app/kibana" from "/" this has stopped working for me.Which version you are using ?I am trying to upgrade from 4,1 to 4.4/4.5

---

<div class="post-metadata">

### Author: ![brayndasilva](https://avatars.discourse-cdn.com/v4/letter/b/2bfe46/32.png) [@brayndasilva](https://discuss.elastic.co/u/brayndasilva)
#### Post date: [April 6, 2016, 7:06am UTC](https://discuss.elastic.co/t/can-someone-share-nginx-config-for-reverse-proxying-kibana4-4-4-5/46326/4 "2016-04-06T07:06:04Z")

</div>

I'm using Kibana 4.4.2

---

<div class="post-metadata">

### Author: ![abhijitdeka11](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@abhijitdeka11](https://discuss.elastic.co/u/abhijitdeka11)
#### Post date: [April 6, 2016, 8:05am UTC](https://discuss.elastic.co/t/can-someone-share-nginx-config-for-reverse-proxying-kibana4-4-4-5/46326/5 "2016-04-06T08:05:12Z")

</div>

Are you using the server.basepath config?

---

<div class="post-metadata">

### Author: ![aarias](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@aarias](https://discuss.elastic.co/u/aarias)
#### Post date: [April 9, 2016, 5:54pm UTC](https://discuss.elastic.co/t/can-someone-share-nginx-config-for-reverse-proxying-kibana4-4-4-5/46326/6 "2016-04-09T17:54:53Z")

</div>

I'm having the same problem with kibana 4.5 and even though @brayndasilva 's solution works, it ONLY works when you use kibana in the root path ('/').

If you want a different path (i.e. setting server.basepath) it won't work.

---

<div class="post-metadata">

### Author: ![abhijitdeka11](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@abhijitdeka11](https://discuss.elastic.co/u/abhijitdeka11)
#### Post date: [April 11, 2016, 3:50am UTC](https://discuss.elastic.co/t/can-someone-share-nginx-config-for-reverse-proxying-kibana4-4-4-5/46326/7 "2016-04-11T03:50:18Z")

</div>

For my use case I can't point it to root('/'). So, I tried working with the server.basepath config. But seems like I am unable to make it work or the feature itself is broken.

---

<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: [August 2, 2016, 6:57pm UTC](https://discuss.elastic.co/t/can-someone-share-nginx-config-for-reverse-proxying-kibana4-4-4-5/46326/8 "2016-08-02T18:57:29Z")

</div>

here:

> [@\[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: ![Vladimir\_Aleksandrov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vladimir_aleksandrov/32/9737_2.png) [@Vladimir\_Aleksandrov](https://discuss.elastic.co/u/Vladimir_Aleksandrov)
#### Post date: [February 17, 2017, 1:49am UTC](https://discuss.elastic.co/t/can-someone-share-nginx-config-for-reverse-proxying-kibana4-4-4-5/46326/9 "2017-02-17T01:49:01Z")

</div>

```auto
location ~ /analytics/(?<kibana_uri>.*) {
   proxy_pass http://127.0.0.1:5601/$kibana_uri;
   proxy_http_version 1.1;
   proxy_set_header Upgrade $http_upgrade;
   proxy_set_header Connection 'upgrade';
   proxy_set_header Host $host;
   proxy_cache_bypass $http_upgrade;
}
# optional block to handle landing url without trailing slash: `/analytics`
location = /analytics {
   return 302 /analytics/;
}

```

This captures the part after `/analytics/` to a `$kibana_uri` variable, which is then used to set the proxy\_pass destination.

This was tested for Kibana 5.2 too.

---

<div class="post-metadata">

### Author: ![Ramya](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@Ramya](https://discuss.elastic.co/u/Ramya)
#### Post date: [June 2, 2017, 10:13am UTC](https://discuss.elastic.co/t/can-someone-share-nginx-config-for-reverse-proxying-kibana4-4-4-5/46326/10 "2017-06-02T10:13:54Z")

</div>

Hi Vladimir\_Aleksandrov  
I have similar issue I have to access the kibana kibana version 5.1.1 through Nginx .But all I get is 404 not found error  
If I access the URL like this [http://localhost:8070/Analytics](http://localhost:8070/Analytics)  
It should go to this URL path [http://localhost:5601/\_plugin/kibana](http://localhost:5601/_plugin/kibana)

Please give me an example config...

---

<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 6, 2017, 1:31pm UTC](https://discuss.elastic.co/t/can-someone-share-nginx-config-for-reverse-proxying-kibana4-4-4-5/46326/11 "2017-07-06T13:31:36Z")

</div>


