# Java High Level Rest Client - including a basepath to request urls

**URL:** <https://discuss.elastic.co/t/java-high-level-rest-client-including-a-basepath-to-request-urls/217533>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [February 2, 2020, 2:29pm UTC](https://discuss.elastic.co/t/java-high-level-rest-client-including-a-basepath-to-request-urls/217533 "2020-02-02T14:29:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SavvySkylark](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@SavvySkylark](https://discuss.elastic.co/u/SavvySkylark)\
**Post date:** [February 2, 2020, 2:29pm UTC](https://discuss.elastic.co/t/java-high-level-rest-client-including-a-basepath-to-request-urls/217533/1 "2020-02-02T14:29:18Z")

</div>

I have an API Gateway that will be put in-front of our elasticsearch APIs. It routes traffic by using a basepath. So a request url would look like the following.

[https://api.example.com/elasticsearch/v1/exampleindex/\_search](https://api.example.com/elasticsearch/v1/exampleindex/_search)

The gateway can send it to elasticsearch without the basepath.

Is there a way to configure the client to include a basepath?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 2, 2020, 3:32pm UTC](https://discuss.elastic.co/t/java-high-level-rest-client-including-a-basepath-to-request-urls/217533/2 "2020-02-02T15:32:35Z")

</div>

Welcome!

This might help: [RestHighLevelClient - Accessing an elastic http endpoint behind reverse proxy](https://discuss.elastic.co/t/resthighlevelclient-accessing-an-elastic-http-endpoint-behind-reverse-proxy/117306/2)

---

<div class="post-metadata">

**Author:** ![SavvySkylark](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@SavvySkylark](https://discuss.elastic.co/u/SavvySkylark)\
**Post date:** [February 2, 2020, 3:50pm UTC](https://discuss.elastic.co/t/java-high-level-rest-client-including-a-basepath-to-request-urls/217533/3 "2020-02-02T15:50:29Z")

</div>

Awesome this is exactly what I needed! Thank you so much!

---

<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:** [March 1, 2020, 3:50pm UTC](https://discuss.elastic.co/t/java-high-level-rest-client-including-a-basepath-to-request-urls/217533/4 "2020-03-01T15:50:32Z")

</div>

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