# Kibana behind nginx relative path

**URL:** <https://discuss.elastic.co/t/kibana-behind-nginx-relative-path/306764>\
**Category:** Kibana\
**Tags:** docker\
**Created:** [June 9, 2022, 7:13am UTC](https://discuss.elastic.co/t/kibana-behind-nginx-relative-path/306764 "2022-06-09T07:13:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hookenful](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hookenful/32/106812_2.png) [@hookenful](https://discuss.elastic.co/u/hookenful)\
**Post date:** [June 9, 2022, 7:13am UTC](https://discuss.elastic.co/t/kibana-behind-nginx-relative-path/306764/1 "2022-06-09T07:13:03Z")

</div>

Hi there!

Trying to achieve working kibana behing nginx relative path. [Mydomain.com/kibana](http://Mydomain.com/kibana) and it is not working.

Mine docker-compose.yml

```auto
kibana:
    image: reg.registry/only/kibana:7.11.2
    environment:
      - SERVER_BASEPATH=/kibana
      - ELASTICSEARCH_USERNAME=elastic
      - ELASTICSEARCH_PASSWORD=xxxxx
      - ELASTICSEARCH_REQUESTTIMEOUT=90000
      - ELASTICSEARCH_URL=http://elasticsearch:9200
      - ELASTICSEARCH_HOSTS=http://elasticsearch:9200
    networks:
     - es
    depends_on:
    - elasticsearch

```

In kibana.yml I have:  
csp.strict: false

And nginx.conf:

```auto
    location /kibana {
       rewrite ^/kibana/(.*)$ $1 break;
        proxy_pass http://kibana:5601;
        proxy_redirect off;
        proxy_buffering off;
        proxy_http_version 1.1;
        proxy_set_header Connection "Keep-Alive";
        proxy_set_header Proxy-Connection "Keep-Alive";
  }

```

When going /kibana there is 502 gateway error..

What did I miss there? Thanks for any help in advance!

---

<div class="post-metadata">

**Author:** ![tiagocosta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tiagocosta/32/40045_2.png) [@tiagocosta](https://discuss.elastic.co/u/tiagocosta)\
**Post date:** [June 9, 2022, 4:52pm UTC](https://discuss.elastic.co/t/kibana-behind-nginx-relative-path/306764/2 "2022-06-09T16:52:03Z")

</div>

Hi @hookenful ,

Is `http://kibana:5601` available to the machine where nginx is currently installed?

Cheers

---

<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 7, 2022, 4:52pm UTC](https://discuss.elastic.co/t/kibana-behind-nginx-relative-path/306764/3 "2022-07-07T16:52:59Z")

</div>

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