# Nginx setup for xpack enabled elastic cluster

**URL:** <https://discuss.elastic.co/t/nginx-setup-for-xpack-enabled-elastic-cluster/135661>\
**Category:** Elasticsearch\
**Created:** [June 13, 2018, 9:17am UTC](https://discuss.elastic.co/t/nginx-setup-for-xpack-enabled-elastic-cluster/135661 "2018-06-13T09:17:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muj33b](https://avatars.discourse-cdn.com/v4/letter/m/ba9def/32.png) [@Muj33b](https://discuss.elastic.co/u/Muj33b)\
**Post date:** [June 13, 2018, 9:17am UTC](https://discuss.elastic.co/t/nginx-setup-for-xpack-enabled-elastic-cluster/135661/1 "2018-06-13T09:17:58Z")

</div>

Hi,  
We've got an ES cluster on GCP, it is 5-3-2 (Data-Master-Client) nodes running on docker containers with X-pack enabled. We want to add nginx load balancer in front of it.

It is similar to [Connect Kibana to Nginx load balancer to Elasticsearch](https://discuss.elastic.co/t/connect-kibana-to-nginx-load-balancer-to-elasticsearch/128028)

We are getting stuck in first stage of Nginx-ES connection (Permission denied) may be because of X-Pack enabled on ES cluster.  
How do we specify the elasticsearch user name and password in nginx.conf?

What is the proper approach (any docs, blogs etc.) to achieve this

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [June 18, 2018, 1:58am UTC](https://discuss.elastic.co/t/nginx-setup-for-xpack-enabled-elastic-cluster/135661/2 "2018-06-18T01:58:48Z")

</div>

> [@Muj33b](#):
>
> How do we specify the elasticsearch user name and password in nginx.conf?

Why would you do that?  
The clients that are connecting to nginx should provide their own authentication - you just want to make sure nginx passes the `Authorization` header through to Elasticsearch.

---

<div class="post-metadata">

**Author:** ![Muj33b](https://avatars.discourse-cdn.com/v4/letter/m/ba9def/32.png) [@Muj33b](https://discuss.elastic.co/u/Muj33b)\
**Post date:** [June 20, 2018, 3:16pm UTC](https://discuss.elastic.co/t/nginx-setup-for-xpack-enabled-elastic-cluster/135661/3 "2018-06-20T15:16:53Z")

</div>

Thanks Tim,  
It is working now, but not completely.  
When I log out, it redirects me to the same page. I am not using SAML so not sure how to specify sp.logout.

Regards  
Muj33b

---

<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 18, 2018, 3:16pm UTC](https://discuss.elastic.co/t/nginx-setup-for-xpack-enabled-elastic-cluster/135661/4 "2018-07-18T15:16:57Z")

</div>

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