# Kibana and reverse proxy nginx

**URL:** <https://discuss.elastic.co/t/kibana-and-reverse-proxy-nginx/248460>\
**Category:** Kibana\
**Created:** [September 13, 2020, 9:54pm UTC](https://discuss.elastic.co/t/kibana-and-reverse-proxy-nginx/248460 "2020-09-13T21:54:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cheroufa](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@Cheroufa](https://discuss.elastic.co/u/Cheroufa)\
**Post date:** [September 13, 2020, 9:54pm UTC](https://discuss.elastic.co/t/kibana-and-reverse-proxy-nginx/248460/1 "2020-09-13T21:54:52Z")

</div>

Hi everybody  
i have a cluster elasticsearch of 3 nodes and two instance of kibana installed on two differents machines for loadbalancing with nginx reverse proxy , i access to kibana UI to login but when i enter my login and password it returns to login page.  
my nginx file conf :  
upstream kibana {

```
    server 192.168.10.9:5601;
    server 192.168.10.6:5601;

```

}

server {

listen 80;

location / {

```
    rewrite ^/kibana/(.*) $1 break;

    proxy_pass http://kibana;

    
    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; 

```

}  
}

any help is welcome 😉

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [September 14, 2020, 9:57am UTC](https://discuss.elastic.co/t/kibana-and-reverse-proxy-nginx/248460/2 "2020-09-14T09:57:10Z")

</div>

Hello,

Something like this works for me:

> set $proxy\_pass\_url [http://localhost:5601](http://localhost:5601);  
> #Main location which proxy's Kibana backend server  
> location / {  
> proxy\_set\_header Host $proxy\_pass\_url;  
> proxy\_set\_header X-Real-IP $remote\_addr;  
> proxy\_http\_version 1.1;  
> proxy\_set\_header Connection "Keep-Alive";  
> proxy\_set\_header Proxy-Connection "Keep-Alive";  
> proxy\_set\_header Authorization "";  
> proxy\_pass $proxy\_pass\_url/;  
> proxy\_redirect $proxy\_pass\_url/ /;  
> }# Reverse proxy of assets and front end app  
> location ~ (/app|/translations|/node\_modules|/built\_assets/|/bundles|/es\_admin|/plugins|/api|/ui|/elasticsearch|/spaces/enter) {  
> proxy\_pass $proxy\_pass\_url;  
> proxy\_set\_header Host $host;  
> proxy\_set\_header X-Real-IP $remote\_addr;  
> proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
> proxy\_set\_header X-Forwarded-Proto $scheme;  
> proxy\_set\_header X-Forwarded-Host $http\_host;  
> proxy\_set\_header Authorization "";  
> proxy\_hide\_header Authorization;  
> }

---

<div class="post-metadata">

**Author:** ![Cheroufa](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@Cheroufa](https://discuss.elastic.co/u/Cheroufa)\
**Post date:** [September 14, 2020, 12:39pm UTC](https://discuss.elastic.co/t/kibana-and-reverse-proxy-nginx/248460/3 "2020-09-14T12:39:12Z")

</div>

Hi can you share all your file conf please and is there any configuration to do in kibana.yml ?

Thanx.

---

<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:** [October 12, 2020, 12:39pm UTC](https://discuss.elastic.co/t/kibana-and-reverse-proxy-nginx/248460/4 "2020-10-12T12:39:22Z")

</div>

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