# RestHighLevelClient - Accessing an elastic http endpoint behind reverse proxy

**URL:** <https://discuss.elastic.co/t/resthighlevelclient-accessing-an-elastic-http-endpoint-behind-reverse-proxy/117306>\
**Category:** Elasticsearch\
**Created:** [January 27, 2018, 2:30pm UTC](https://discuss.elastic.co/t/resthighlevelclient-accessing-an-elastic-http-endpoint-behind-reverse-proxy/117306 "2018-01-27T14:30:42Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![missourian](https://avatars.discourse-cdn.com/v4/letter/m/a5b964/32.png) [@missourian](https://discuss.elastic.co/u/missourian)\
**Post date:** [January 30, 2018, 12:59am UTC](https://discuss.elastic.co/t/resthighlevelclient-accessing-an-elastic-http-endpoint-behind-reverse-proxy/117306/2 "2018-01-30T00:59:16Z")

</div>

Well, I did find the answer. I should have investigated the API little more 🙂

@Bean  
public RestHighLevelClient elasticClient() {

```
return new RestHighLevelClient(RestClient.builder(
    new HttpHost(elastichost, elasticport, DEFAULT_SCHEME_NAME)).setPathPrefix("/elastic"));

```

}

Tookcare of the reverse proxy path prefix

---

_[View the full topic](https://discuss.elastic.co/t/resthighlevelclient-accessing-an-elastic-http-endpoint-behind-reverse-proxy/117306)._
