# ElasticSearch Clustering authentication with Nginx

**URL:** <https://discuss.elastic.co/t/elasticsearch-clustering-authentication-with-nginx/46956>\
**Category:** Elasticsearch\
**Created:** [April 11, 2016, 8:14am UTC](https://discuss.elastic.co/t/elasticsearch-clustering-authentication-with-nginx/46956 "2016-04-11T08:14:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghasem1992](https://avatars.discourse-cdn.com/v4/letter/g/ba8739/32.png) [@ghasem1992](https://discuss.elastic.co/u/ghasem1992)\
**Post date:** [April 11, 2016, 8:14am UTC](https://discuss.elastic.co/t/elasticsearch-clustering-authentication-with-nginx/46956/1 "2016-04-11T08:14:14Z")

</div>

I have an ElasticSearch cluster with a master node on server 192.168.30.141 and 5 data nodes on some other servers. I have set up a nginx reverse proxy server on server 192.168.30.141 for basic authentication. My cluster data nodes can't discover master node. How can I resolve this problem? Is it necessary to install nginx on data nodes?

My ngnix configuration is as follow:  
`events { worker_connections 1024; } http { upstream elasticsearch { server 127.0.0.1:9200; } server { listen 9200; auth_basic "Protected Elasticsearch"; auth_basic_user_file passwords; location / { proxy_pass http://elasticsearch; proxy_redirect off; } } }`

My master node configudarion is as follow:  
`node.master: true node.data: false network.host: 127.0.0.1 http.port: 9200`

My data node configuration is as follow:  
`node.master: false node.data: true network.host: 192.168.30.142 http.port: 9200 discovery.zen.ping.unicast.hosts: ["192.168.30.141"] // master node ip`

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 11, 2016, 8:41am UTC](https://discuss.elastic.co/t/elasticsearch-clustering-authentication-with-nginx/46956/2 "2016-04-11T08:41:25Z")

</div>

> [@ghasem1992](#):
>
> network.host: 127.0.0.1

That's why, your master will never listen on anything other than the loopback address.

---

<div class="post-metadata">

**Author:** ![ghasem1992](https://avatars.discourse-cdn.com/v4/letter/g/ba8739/32.png) [@ghasem1992](https://discuss.elastic.co/u/ghasem1992)\
**Post date:** [April 12, 2016, 2:42am UTC](https://discuss.elastic.co/t/elasticsearch-clustering-authentication-with-nginx/46956/3 "2016-04-12T02:42:43Z")

</div>

my master node just response to requests from proxy server.  
upstream elasticsearch {  
server 127.0.0.1:9200;  
}  
proxy server receives every request on port 9200 and after authentication send it to elasticSearch.  
nginx (proxy server) and master node is installed on same server,

---

<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:** [July 5, 2017, 11:00pm UTC](https://discuss.elastic.co/t/elasticsearch-clustering-authentication-with-nginx/46956/4 "2017-07-05T23:00:28Z")

</div>


