# Unable to connect to ECE Cluster with Load Balancer

**URL:** <https://discuss.elastic.co/t/unable-to-connect-to-ece-cluster-with-load-balancer/180950>\
**Category:** Elastic Cloud Enterprise (ECE)\
**Created:** [May 14, 2019, 8:28am UTC](https://discuss.elastic.co/t/unable-to-connect-to-ece-cluster-with-load-balancer/180950 "2019-05-14T08:28:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ong/32/40766_2.png) [@Ong](https://discuss.elastic.co/u/Ong)\
**Post date:** [May 14, 2019, 8:28am UTC](https://discuss.elastic.co/t/unable-to-connect-to-ece-cluster-with-load-balancer/180950/1 "2019-05-14T08:28:26Z")

</div>

I have Nginx as a LB which sits in front of the ECE proxy.

When I added a wildcard DNS which pointed directly to the ECE proxy IP, I was able to connect to the cluster using the cluster endpoint. The DNS record is:  
`*.ece.org -> 10.1.2.3, where 10.1.2.3 is the proxy IP)`

When a LB sits in front of the proxy, the connection does not work. First, I added a wildcard DNS which points to the LB  
`*.ece.org -> 10.1.2.99 (where 10.1.2.99 is the IP of the load balancer)`

Then, in the nginx load balancer, the conf file is as follows:

```
upstream ece-proxies{ server 10.1.2.3:9200;}
server{
    listen 80;
    server_name *.ece.org;
    location / {
        proxy_pass http://ece-proxies/;
}

```

Is it correct that the LB just points directly to the IP of the proxy machine?

When I entered the proxy machine IP and port directly in the browser, nothing was returned.

---

<div class="post-metadata">

**Author:** ![Alex\_Piggott](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_piggott/32/11053_2.png) [@Alex\_Piggott](https://discuss.elastic.co/u/Alex_Piggott)\
**Post date:** [May 14, 2019, 1:17pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-ece-cluster-with-load-balancer/180950/2 "2019-05-14T13:17:09Z")

</div>

You need to have `proxy_http_version 1.1;` under `location /`, otherwise looks OK

If adding that didn't work, can you get any debug logging from nginx? My guess would be that it was some hard-to-spot-with-the-eye misconfig in that case

---

<div class="post-metadata">

**Author:** ![Ong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ong/32/40766_2.png) [@Ong](https://discuss.elastic.co/u/Ong)\
**Post date:** [May 15, 2019, 11:16am UTC](https://discuss.elastic.co/t/unable-to-connect-to-ece-cluster-with-load-balancer/180950/3 "2019-05-15T11:16:01Z")

</div>

Yes, I added the `proxy_http_version 1.1` and `proxy_set_header HOST $host` lines and the cluster endpoint URL is able to connect via the nginx load balancer now. Thanks for the tip

However, there is a need to remove the port from the URL, otherwise the endpoint does not connect. e.g. http://(clusterID).ece.org can connect but http://(clusterID).ece.org:9200 is not able to connect.

Is this considered correct or is there additional configuration needed?

---

<div class="post-metadata">

**Author:** ![Alex\_Piggott](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_piggott/32/11053_2.png) [@Alex\_Piggott](https://discuss.elastic.co/u/Alex_Piggott)\
**Post date:** [May 15, 2019, 12:53pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-ece-cluster-with-load-balancer/180950/4 "2019-05-15T12:53:05Z")

</div>

> [@Ong](#):
>
> However, there is a need to remove the port from the URL, otherwise the endpoint does not connect. e.g. http://(clusterID).ece.org can connect but http://(clusterID).ece.org:9200 is not able to connect.

Isn't that just because of the `listen 80` declaration? ie your nginx is configured to listen on 80 and route to 9200? Apologies if I misunderstood!

---

<div class="post-metadata">

**Author:** ![Ong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ong/32/40766_2.png) [@Ong](https://discuss.elastic.co/u/Ong)\
**Post date:** [May 16, 2019, 8:56am UTC](https://discuss.elastic.co/t/unable-to-connect-to-ece-cluster-with-load-balancer/180950/6 "2019-05-16T08:56:54Z")

</div>

Yes, nginx is listens on port 80 and routes it to 9200. Looks like it is correct. Thanks!

---

<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:** [May 30, 2019, 9:05am UTC](https://discuss.elastic.co/t/unable-to-connect-to-ece-cluster-with-load-balancer/180950/7 "2019-05-30T09:05:02Z")

</div>

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