# Kibana and Nginx

**URL:** https://discuss.elastic.co/t/kibana-and-nginx/31964
**Category:** Kibana
**Created:** [October 11, 2015, 1:34am UTC](https://discuss.elastic.co/t/kibana-and-nginx/31964 "2015-10-11T01:34:29Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![DocMAX](https://avatars.discourse-cdn.com/v4/letter/d/6bbea6/32.png) [@DocMAX](https://discuss.elastic.co/u/DocMAX)
#### Post date: [October 11, 2015, 1:34am UTC](https://discuss.elastic.co/t/kibana-and-nginx/31964/1 "2015-10-11T01:34:29Z")

</div>

hi,

i can't proxy my kibana server.  
my config is

```
	location /kibana {
		rewrite ^/kibana/?(.*)$ /$1 break;
		proxy_pass http://app-v:5601;
	}

```

and when i enter [http://router/kibana](http://router/kibana) i get

Not Found  
The requested URL /app/kibana was not found on this server.

removing rewrite and i get

{"statusCode":404,"error":"Not Found"}

any help is really appreciated!

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [October 11, 2015, 4:06pm UTC](https://discuss.elastic.co/t/kibana-and-nginx/31964/2 "2015-10-11T16:06:01Z")

</div>

I wouldn't expect the rewrite line to have to be there. I'd fire up the browser's debugging console to find out which URL is getting a 404. You may have to add a slash to both URLs, i.e. do this:

```
location /kibana/ {
        proxy_pass http://app-v:5601/;
}
```

---

<div class="post-metadata">

### Author: ![DocMAX](https://avatars.discourse-cdn.com/v4/letter/d/6bbea6/32.png) [@DocMAX](https://discuss.elastic.co/u/DocMAX)
#### Post date: [October 11, 2015, 10:31pm UTC](https://discuss.elastic.co/t/kibana-and-nginx/31964/3 "2015-10-11T22:31:48Z")

</div>

browser debug:  
[http://app-v:5601/favicon.ico](http://app-v:5601/favicon.ico) Failed to load resource: the server responded with a status of 404 (Not Found)

no matter what i do, either with or without "/", it sends me to /app/kibana or 404.

location /kibana/ {  
proxy\_pass [http://app-v:5601/;](http://app-v:5601/;)  
}

results in:

Not Found  
The requested URL /app/kibana was not found on this server.

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [October 12, 2015, 3:52am UTC](https://discuss.elastic.co/t/kibana-and-nginx/31964/4 "2015-10-12T03:52:35Z")

</div>

> browser debug:  
> [http://app-v:5601/favicon.ico](http://app-v:5601/favicon.ico) Failed to load resource: the server responded with a status of 404 (Not Found)

Okay, but that's harmless and nothing you should pay attention to.

Not sure what's up with the rest.

---

<div class="post-metadata">

### Author: ![raamee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raamee/32/5110_2.png) [@raamee](https://discuss.elastic.co/u/raamee)
#### Post date: [October 12, 2015, 3:36pm UTC](https://discuss.elastic.co/t/kibana-and-nginx/31964/5 "2015-10-12T15:36:53Z")

</div>

My Nginx config for kibana interface. Hope it helps.

```
server {
listen 80;

server_name kibana.interface;

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;        
}
}
```

---

<div class="post-metadata">

### Author: ![DocMAX](https://avatars.discourse-cdn.com/v4/letter/d/6bbea6/32.png) [@DocMAX](https://discuss.elastic.co/u/DocMAX)
#### Post date: [October 12, 2015, 5:15pm UTC](https://discuss.elastic.co/t/kibana-and-nginx/31964/6 "2015-10-12T17:15:39Z")

</div>

This is for location "/", which works for me too.  
I'm talking about location "/kibana"

---

<div class="post-metadata">

### Author: ![florissmit10](https://avatars.discourse-cdn.com/v4/letter/f/8e8cbc/32.png) [@florissmit10](https://discuss.elastic.co/u/florissmit10)
#### Post date: [November 27, 2015, 10:04am UTC](https://discuss.elastic.co/t/kibana-and-nginx/31964/7 "2015-11-27T10:04:28Z")

</div>

I'm having the same problems, trying to run kibana on /kibana.

Do you have a Nginx configuration file to do this?

---

<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, 6:08pm UTC](https://discuss.elastic.co/t/kibana-and-nginx/31964/8 "2016-04-09T18:08:17Z")

</div>

Is there a clear answer to this problem or is this still a mistery since october last year?

@DocMAX@florissmit10 did you manage to make this work?

I too want to make kibana run on /kibana (or anything else except "/")!

---

<div class="post-metadata">

### Author: ![nateuni](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nateuni/32/8512_2.png) [@nateuni](https://discuss.elastic.co/u/nateuni)
#### Post date: [May 18, 2016, 12:20pm UTC](https://discuss.elastic.co/t/kibana-and-nginx/31964/9 "2016-05-18T12:20:51Z")

</div>

Here with exactly the same issue!

---

<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:53pm UTC](https://discuss.elastic.co/t/kibana-and-nginx/31964/10 "2017-07-06T13:53:02Z")

</div>


