# Reverse proxy with nginx

**URL:** https://discuss.elastic.co/t/reverse-proxy-with-nginx/80244
**Category:** Kibana
**Created:** [March 28, 2017, 6:06am UTC](https://discuss.elastic.co/t/reverse-proxy-with-nginx/80244 "2017-03-28T06:06:26Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![gmmurugan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gmmurugan/32/12488_2.png) [@gmmurugan](https://discuss.elastic.co/u/gmmurugan)
#### Post date: [March 28, 2017, 6:06am UTC](https://discuss.elastic.co/t/reverse-proxy-with-nginx/80244/1 "2017-03-28T06:06:26Z")

</div>

do i need to config reverse proxy even for kibana 5? why its been a manual task?

any better cookbook available?

its not working anyway.. getting 404

---

<div class="post-metadata">

### Author: ![pjanzen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pjanzen/32/13756_2.png) [@pjanzen](https://discuss.elastic.co/u/pjanzen)
#### Post date: [March 28, 2017, 6:15am UTC](https://discuss.elastic.co/t/reverse-proxy-with-nginx/80244/2 "2017-03-28T06:15:00Z")

</div>

Without telling what the config is it's hard to determine whats wrong. About the manual taks, setting up a reverse proxy is a trival task. I use the following config.

```
set $kibana 172.25.33.100;
location / {
    proxy_pass http://$kibana:5601;
    proxy_set_header Host $host;
    proxy_set_header Referer "";
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_http_version 1.1;
    proxy_connect_timeout 150;
    proxy_send_timeout 100;
    proxy_read_timeout 100;
    proxy_buffers 16 64k;
    proxy_busy_buffers_size 64k;
    client_max_body_size 256k;
    client_body_buffer_size 128k;
 }

```

And this works fine for me.

Also if you need a cookbook, why not create one and contribute to the comunity? sharing = recieving...

Paul.

---

<div class="post-metadata">

### Author: ![gmmurugan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gmmurugan/32/12488_2.png) [@gmmurugan](https://discuss.elastic.co/u/gmmurugan)
#### Post date: [March 28, 2017, 6:26am UTC](https://discuss.elastic.co/t/reverse-proxy-with-nginx/80244/3 "2017-03-28T06:26:03Z")

</div>

> [@pjanzen](#):
>
> set $kibana 172.25.33.100;  
> location / {  
> proxy\_pass http://:5601$kibana;  
> proxy\_set\_header Host $host;  
> proxy\_set\_header Referer "";  
> proxy\_set\_header X-Real-IP $remote\_addr;  
> proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
> proxy\_http\_version 1.1;  
> proxy\_connect\_timeout 150;  
> proxy\_send\_timeout 100;  
> proxy\_read\_timeout 100;  
> proxy\_buffers 16 64k;  
> proxy\_busy\_buffers\_size 64k;  
> client\_max\_body\_size 256k;  
> client\_body\_buffer\_size 128k;  
> }

server {  
listen 0.0.0.0:80;

server\_name localhost;  
access\_log /var/log/nginx/localhost.log;

location / {  
proxy\_pass [http://localhost:5601](http://localhost:5601);  
proxy\_read\_timeout 90;  
}  
}

---

<div class="post-metadata">

### Author: ![gmmurugan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gmmurugan/32/12488_2.png) [@gmmurugan](https://discuss.elastic.co/u/gmmurugan)
#### Post date: [March 28, 2017, 6:26am UTC](https://discuss.elastic.co/t/reverse-proxy-with-nginx/80244/4 "2017-03-28T06:26:37Z")

</div>

this is what i used and when i used yours i see error in restarting the service

---

<div class="post-metadata">

### Author: ![pjanzen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pjanzen/32/13756_2.png) [@pjanzen](https://discuss.elastic.co/u/pjanzen)
#### Post date: [March 28, 2017, 6:42am UTC](https://discuss.elastic.co/t/reverse-proxy-with-nginx/80244/5 "2017-03-28T06:42:26Z")

</div>

Whats the error you see? And is that all the nginx config you have?

---

<div class="post-metadata">

### Author: ![gmmurugan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gmmurugan/32/12488_2.png) [@gmmurugan](https://discuss.elastic.co/u/gmmurugan)
#### Post date: [March 28, 2017, 1:30pm UTC](https://discuss.elastic.co/t/reverse-proxy-with-nginx/80244/6 "2017-03-28T13:30:52Z")

</div>

Redirecting to /bin/systemctl restart nginx.service  
Job for nginx.service failed because the control process exited with error code.  
See "systemctl status nginx.service" and "journalctl -xe" for details.

do i need to use the localhost/floating ip address in the set kibana?

---

<div class="post-metadata">

### Author: ![gmmurugan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gmmurugan/32/12488_2.png) [@gmmurugan](https://discuss.elastic.co/u/gmmurugan)
#### Post date: [March 28, 2017, 1:31pm UTC](https://discuss.elastic.co/t/reverse-proxy-with-nginx/80244/7 "2017-03-28T13:31:21Z")

</div>

btb, in which file i need to update

---

<div class="post-metadata">

### Author: ![pjanzen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pjanzen/32/13756_2.png) [@pjanzen](https://discuss.elastic.co/u/pjanzen)
#### Post date: [March 29, 2017, 5:14am UTC](https://discuss.elastic.co/t/reverse-proxy-with-nginx/80244/8 "2017-03-29T05:14:31Z")

</div>

You need to use you own configured ip address, if that is a float I assume you have some sort of load balancer. If so you need to apply that configuration on all hosts.

---

<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: [April 26, 2017, 5:15am UTC](https://discuss.elastic.co/t/reverse-proxy-with-nginx/80244/9 "2017-04-26T05:15:10Z")

</div>

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