# Nginx config for reverse proxying Kibana 5.1.1

**URL:** https://discuss.elastic.co/t/nginx-config-for-reverse-proxying-kibana-5-1-1/88051
**Category:** Kibana
**Created:** [June 2, 2017, 9:40am UTC](https://discuss.elastic.co/t/nginx-config-for-reverse-proxying-kibana-5-1-1/88051 "2017-06-02T09:40:28Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)
#### Post date: [June 6, 2017, 2:21pm UTC](https://discuss.elastic.co/t/nginx-config-for-reverse-proxying-kibana-5-1-1/88051/2 "2017-06-06T14:21:57Z")

</div>

Hi @Ramya,

from your config snippet it looks like `$kibana_uri` is not defined. I guess for your purpose you want to assign that name to the regex capture group as in `location ~ /analytics/(?<kibana_uri>.*) {`.

To get `http://server/analytics` to work you probably also need to handle the case of the missing trailing slash. As suggested in [Can someone share nginx config for reverse proxying Kibana4.4/4,5](https://discuss.elastic.co/t/can-someone-share-nginx-config-for-reverse-proxying-kibana4-4-4-5/46326/9), this might do the trick:

```
location = /analytics {
   return 302 /analytics/;
}
```

---

_[View the full topic](https://discuss.elastic.co/t/nginx-config-for-reverse-proxying-kibana-5-1-1/88051)._
