# Elastic agent fleet enrollment with Nginx authentication help

**URL:** <https://discuss.elastic.co/t/elastic-agent-fleet-enrollment-with-nginx-authentication-help/259311>\
**Category:** Elasticsearch\
**Tags:** elastic-agent\
**Created:** [December 22, 2020, 12:08am UTC](https://discuss.elastic.co/t/elastic-agent-fleet-enrollment-with-nginx-authentication-help/259311 "2020-12-22T00:08:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgarcia](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@jgarcia](https://discuss.elastic.co/u/jgarcia)\
**Post date:** [December 22, 2020, 12:08am UTC](https://discuss.elastic.co/t/elastic-agent-fleet-enrollment-with-nginx-authentication-help/259311/1 "2020-12-22T00:08:05Z")

</div>

I setup an ELK stack server along with Nginx. I am trying to make use of the Elastic Agent Fleet enrollment so that I can utilize the endpoint security and do some digging. However, I noticed that if I try to enroll an agent, I get a message "401 Authorization Required" - which I assume is Nginx blocking the request since I have both Kibana and ES behind Nginx. I can login just fine if I visit the url, but I am not sure what to do when it comes to enrolling an agent when the stack is behind Nginx. Any help or advice would be much appreciated, still new to this!

---

<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:** [December 22, 2020, 12:30am UTC](https://discuss.elastic.co/t/elastic-agent-fleet-enrollment-with-nginx-authentication-help/259311/2 "2020-12-22T00:30:14Z")

</div>

Welcome to our community! 😃

What's the reason for using nginx in front of the services?

---

<div class="post-metadata">

**Author:** ![jgarcia](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@jgarcia](https://discuss.elastic.co/u/jgarcia)\
**Post date:** [December 22, 2020, 12:37am UTC](https://discuss.elastic.co/t/elastic-agent-fleet-enrollment-with-nginx-authentication-help/259311/3 "2020-12-22T00:37:34Z")

</div>

Honestly, I was following a guide and it mentioned to use it. I was thinking about removing or disabling Nginx but I couldn't seem to figure out how to revert and not use Nginx anymore. I wanted to just stay using the xpack security but I can't seem to get Nginx turned off successfully to revert back. So I suppose help with either would be great!

---

<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:** [December 22, 2020, 12:44am UTC](https://discuss.elastic.co/t/elastic-agent-fleet-enrollment-with-nginx-authentication-help/259311/4 "2020-12-22T00:44:20Z")

</div>

If you've got Security enabled you should be good, otherwise it just adds a layer of complexity you may not need.

---

<div class="post-metadata">

**Author:** ![jgarcia](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@jgarcia](https://discuss.elastic.co/u/jgarcia)\
**Post date:** [December 22, 2020, 12:49am UTC](https://discuss.elastic.co/t/elastic-agent-fleet-enrollment-with-nginx-authentication-help/259311/5 "2020-12-22T00:49:54Z")

</div>

That's what I figured, how would I properly discontinue use of Nginx from the stack then?

---

<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:** [December 22, 2020, 12:58am UTC](https://discuss.elastic.co/t/elastic-agent-fleet-enrollment-with-nginx-authentication-help/259311/6 "2020-12-22T00:58:16Z")

</div>

I'm not sure how you set it all up, but I'd just point the agent directly to Elasticsearch and Kibana and then remove nginx.

---

<div class="post-metadata">

**Author:** ![jgarcia](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@jgarcia](https://discuss.elastic.co/u/jgarcia)\
**Post date:** [December 22, 2020, 1:13am UTC](https://discuss.elastic.co/t/elastic-agent-fleet-enrollment-with-nginx-authentication-help/259311/7 "2020-12-22T01:13:17Z")

</div>

Thanks for the help, got it figured out! 😀

---

<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:** [January 19, 2021, 1:13am UTC](https://discuss.elastic.co/t/elastic-agent-fleet-enrollment-with-nginx-authentication-help/259311/8 "2021-01-19T01:13:37Z")

</div>

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