# Kibana 7.12 nginx reverse proxy, docker compose

**URL:** <https://discuss.elastic.co/t/kibana-7-12-nginx-reverse-proxy-docker-compose/270776>\
**Category:** Kibana\
**Created:** [April 21, 2021, 12:57am UTC](https://discuss.elastic.co/t/kibana-7-12-nginx-reverse-proxy-docker-compose/270776 "2021-04-21T00:57:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ElasticLiver](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticliver/32/64869_2.png) [@ElasticLiver](https://discuss.elastic.co/u/ElasticLiver)\
**Post date:** [April 21, 2021, 12:57am UTC](https://discuss.elastic.co/t/kibana-7-12-nginx-reverse-proxy-docker-compose/270776/1 "2021-04-21T00:57:46Z")

</div>

Hi Im trying to use nginx as a reverse proxy for kibana but I can make it work, this is my kibana.yml

```auto
server.name: kibana
server.host: "localhost"
elasticsearch.hosts: ["https://elasticsearch:9200"]
elasticsearch.username: kibana
elasticsearch.password: mypassword
server.ssl.enabled: true
server.ssl.certificate: /usr/share/kibana/newfile.crt.pem
server.ssl.key: /usr/share/kibana/newfile.key.pem
elasticsearch.ssl.verificationMode: none
xpack.encryptedSavedObjects.encryptionKey: "myencriptionkey"
server.publicBaseUrl: "https://127.0.0.1:9977"
server.basePath: "/kibana"
server.rewriteBasePath: true

```

this is the docker compose file

```auto
  kibana:
    image: docker.elastic.co/kibana/kibana:7.12.0
    volumes:
    - ./config/kibana.yml:/usr/share/kibana/config/kibana.yml:ro
    - ./certificates/newfile.crt.pem:/usr/share/kibana/newfile.crt.pem
    - ./certificates/newfile.key.pem:/usr/share/kibana/newfile.key.pem
    ports:
    - "5601:5601"
    links:
    - elasticsearch
    container_name: kibana

  nginx:
    image: nginx
    ports:
    - "6601:6601"
    volumes:
    - ./nginx/:/etc/nginx/conf.d/
    - ./nginx/:/var/log/nginx
    links:
    - kibana

```

and this is my default.conf for nginx

```auto
server {
    listen 6601;
    include /etc/nginx/default.d/*.conf;
    location /kibana/ {

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

```

this is one of the errors that im getting:

```auto
2021/04/21 00:39:04 [error] 22#22: *1 no live upstreams while connecting to upstream, client: 172.21.101.254, server: , request: "GET /kibana/ HTTP/1.1", upstream: "http://localhost/kibana/", host: "172.21.101.21:6601

```

what Im doing wrong?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [April 21, 2021, 4:36am UTC](https://discuss.elastic.co/t/kibana-7-12-nginx-reverse-proxy-docker-compose/270776/2 "2021-04-21T04:36:46Z")

</div>

> [@ElasticLiver](#):
>
> `proxy_pass http://localhost:5601`

This is wrong, it means that you want to pass the requests you are receiving in the `nginx` container on the port `6601` to the same container in the port `5601`, localhost **always** means the same host.

You should try to set it to `http://kibana:5601`.

---

<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:** [May 19, 2021, 4:37am UTC](https://discuss.elastic.co/t/kibana-7-12-nginx-reverse-proxy-docker-compose/270776/3 "2021-05-19T04:37:39Z")

</div>

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