# Elasticsearch + Xpack + Kibana + Docker + Nginx

**URL:** https://discuss.elastic.co/t/elasticsearch-xpack-kibana-docker-nginx/274368
**Category:** Kibana
**Tags:** elastic-stack-security, docker
**Created:** [May 28, 2021, 6:21pm UTC](https://discuss.elastic.co/t/elasticsearch-xpack-kibana-docker-nginx/274368 "2021-05-28T18:21:23Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![feelan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/feelan/32/88204_2.png) [@feelan](https://discuss.elastic.co/u/feelan)
#### Post date: [May 28, 2021, 6:21pm UTC](https://discuss.elastic.co/t/elasticsearch-xpack-kibana-docker-nginx/274368/1 "2021-05-28T18:21:23Z")

</div>

Hello. I am having a problem with kibana working. I have an elastic cluster of 3 nodes. For fault tolerance, I decided to install kibana in swarm-cluster with Nginx Reverse Proxy. When trying to log in, I am catching a 302 redirect loop. (ERR\_TOO\_MANY\_REDIRECTS) How can I solve this?

> **Kibna config**
>
> ```auto
> server.host: 0.0.0.0
> server.port: 5601
> 
> #Elastic node
> elasticsearch.hosts:
> - https://ip:9200
> - https://ip:9200
> - https://ip:9200
> 
> #frequency query refresh node
> elasticsearch.sniffInterval: 60000
> elasticsearch.sniffOnConnectionFault: true
> 
> elasticsearch.ssl.certificateAuthorities: ["/usr/share/kibana/config/cert/elasticsearch-ca.pem"]
> 
> server.ssl.enabled: true
> server.ssl.keystore.path: "/usr/share/kibana/config/cert/kibana-cert.p12"
> server.ssl.truststore.path: "/usr/share/kibana/config/cert/elastic-stack-ca.p12"
> 
> ```

> **Nginx config**
>
> ```auto
> server {
> listen 80;
> server_name domain;
> 
> location /.well-known/acme-challenge/ {
> root /var/www/html;
> }
> location / {
> return 301 https://$server_name$request_uri;
> }
> }
> 
> server {
> listen 443 ssl http2;
> server_name domain;
> 
> ssl_certificate /etc/letsencrypt/live/domain/fullchain.pem;
> ssl_certificate_key /etc/letsencrypt/live/domain/privkey.pem;
> ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
> 
> location / {
> proxy_http_version 1.1;
> proxy_pass https://kibana:5601;
> proxy_set_header Upgrade $http_upgrade;
> proxy_set_header Connection 'upgrade';
> proxy_set_header Host $host;
> proxy_cache_bypass $http_upgrade;
> }
> }
> 
> ```

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/2/727d506a74b60fd90a0482e1702f971836c727a3.png)

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [May 31, 2021, 6:50am UTC](https://discuss.elastic.co/t/elasticsearch-xpack-kibana-docker-nginx/274368/2 "2021-05-31T06:50:18Z")

</div>

Welcome to our community! 😃

Can you elaborate more on why you implemented nginx?

---

<div class="post-metadata">

### Author: ![feelan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/feelan/32/88204_2.png) [@feelan](https://discuss.elastic.co/u/feelan)
#### Post date: [June 5, 2021, 6:48pm UTC](https://discuss.elastic.co/t/elasticsearch-xpack-kibana-docker-nginx/274368/3 "2021-06-05T18:48:00Z")

</div>

We implemented nginx because we restrict access to the resource through our openvpn.

---

<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 3, 2021, 6:49pm UTC](https://discuss.elastic.co/t/elasticsearch-xpack-kibana-docker-nginx/274368/4 "2021-07-03T18:49:01Z")

</div>

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