Nginx Proxy and OpensearchDashboard

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:

 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:

  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!

@basitmm Please share your opensearch_dashboards.yml and config.yml files.

solved…
I had to add:

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

to my docker-compose file…
thanks

1 Like

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