Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Load Balancing for a Wildcard DNS does not work

$
0
0
I am trying to use NGINX as a load balancer for an Elastic Cloud Enterprise platform which consists of 3 VMs. The intention is to load balance a query e.g. http://xxxxxxx.ece.dev.org:9200 where xxxxxx refers to the Elasticsearch cluster and is variable depending on the elasticsearch cluster.

I have a wildcard DNS record which directs *.ece.dev.org to the NGINX IP
e.g. *.ece.dev.org -> 10.1.2.99

Then in the conf file, the server is defined as:

upstream ece-proxy{
server 10.1.2.3:9200; #these are the servers which host the platform
server 10.1.2.4:9200;
server 10.1.2.5:9200;
}

server{
listen 80;
server_name *.ece.dev.org;
location / {
proxy_pass http://ece-proxy;
proxy_http_version 1.1;
proxy_set_header Host $host;
}
}

When I used the nginx configuration above, the URL http://xxxxxxxxxx.ece.dev.org:9200 was not able to connect.

If the wildcard DNS record directly resolves to one of the cloud VMs (e.g. *.ece.dev.org -> 10.1.2.3), then the URL is able to connect successfully.

(Directly entering 10.1.2.3:9200 or 10.1.2.4:9200 etc does not return anything. A cluster ID must be provided)

How should NGINX be configured to handle wildcard sub domains for load balancing?

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>