nginx reverse proxy for elasticsearch

Viewed 456

I used nginx proxy for elasticsearch http://localhost:9200 as below shown

  location  /elasticsearch {

        proxy_pass   http://localhost:9200;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;

    }

but when i try to run https://<nginx_server>/elasticsearch I got below error, any idea why? maybe I need change basePath and rewriteBasePath at elasticsearch.yml?but i did not find this option. I could not use subdoamin (e.g elasticsearch.domain_name) , i am sure if I can use suddomain for servername at nginix conf, it will be no problem at all

{"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index","resource.type":"index_or_alias","resource.id":"elasticsearch","index_uuid":"_na_","index":"elasticsearch"}],"type":"index_not_found_exception","reason":"no such index","resource.type":"index_or_alias","resource.id":"elasticsearch","index_uuid":"_na_","index":"elasticsearch"},"status":404}
0 Answers
Related