# Nginx Proxy and OpensearchDashboard

**URL:** <https://forum.opensearch.org/t/nginx-proxy-and-opensearchdashboard/14823>\
**Category:** OpenSearch\
**Created:** [June 26, 2023, 9:07am UTC](https://forum.opensearch.org/t/nginx-proxy-and-opensearchdashboard/14823 "2023-06-26T09:07:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![basitmm](https://avatars.discourse-cdn.com/v4/letter/b/ce73a5/32.png) [@basitmm](https://forum.opensearch.org/u/basitmm)\
**Post date:** [June 26, 2023, 9:07am UTC](https://forum.opensearch.org/t/nginx-proxy-and-opensearchdashboard/14823/1 "2023-06-26T09:07:00Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):  
newest / 2.8 + Docker

**Describe the issue** :  
Hi,  
I want to call my Dashboard via a subdomain. On my server I installed a nGinx server with Certbot.  
Now I want to call “/dshbrd” and pass this to my Dashboard-Docker…

What is the correct setting for my docker-compose? At the moment the dashboard refreshs the call to a 302 “/” instead of serving the dashbaord…

nginx Conf:

```auto
 location /dshbrd {
        auth_basic "Administrator’s Area";
        auth_basic_user_file /srv/configs/.htpasswd;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_pass http://127.0.0.1:5601;
    }

```

docker-compose for dashboard:

```auto
  opensearch-dashboards:
    image: opensearchproject/opensearch-dashboards:2.8.0
    container_name: bm-suche-dashboards
    ports:
      - 127.0.0.1:5601:5601
    expose:
      - "5601"
    environment:
# OPENSEARCH_HOSTS: '["https://xxx-node1:9200"]' # must be a string with no spaces when specified as an environment variabl
      - 'OPENSEARCH_HOSTS=["http://xxx-node:9200"]'
      - "DISABLE_SECURITY_DASHBOARDS_PLUGIN=true" # disables security dashboards plugin in OpenSearch Dashboards
    networks:
      - opensearch-net

```

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![pablo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/pablo/32/10363_2.png) [@pablo](https://forum.opensearch.org/u/pablo)\
**Post date:** [June 26, 2023, 10:17am UTC](https://forum.opensearch.org/t/nginx-proxy-and-opensearchdashboard/14823/2 "2023-06-26T10:17:42Z")

</div>

@basitmm Please share your opensearch\_dashboards.yml and config.yml files.

---

<div class="post-metadata">

**Author:** ![basitmm](https://avatars.discourse-cdn.com/v4/letter/b/ce73a5/32.png) [@basitmm](https://forum.opensearch.org/u/basitmm)\
**Post date:** [June 26, 2023, 10:54am UTC](https://forum.opensearch.org/t/nginx-proxy-and-opensearchdashboard/14823/3 "2023-06-26T10:54:03Z")

</div>

> [@pablo](#):
>
> opensearch\_dashboards.yml

solved…  
I had to add:

```auto
      - 'SERVER_BASEPATH="/dshbrd"'
      - 'SERVER_REWRITEBASEPATH=true'

```

to my docker-compose file…  
thanks

---

<div class="post-metadata">

**Author:** ![pablo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/pablo/32/10363_2.png) [@pablo](https://forum.opensearch.org/u/pablo)\
**Post date:** [June 26, 2023, 11:18am UTC](https://forum.opensearch.org/t/nginx-proxy-and-opensearchdashboard/14823/4 "2023-06-26T11:18:57Z")

</div>

@basitmm That’s what I was looking for. Great to hear it’s working for you.
