# Filebeat 401 Unauth

**URL:** <https://discuss.elastic.co/t/filebeat-401-unauth/134709>\
**Category:** Beats\
**Created:** [June 5, 2018, 11:47pm UTC](https://discuss.elastic.co/t/filebeat-401-unauth/134709 "2018-06-05T23:47:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![d3sire](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@d3sire](https://discuss.elastic.co/u/d3sire)\
**Post date:** [June 5, 2018, 11:47pm UTC](https://discuss.elastic.co/t/filebeat-401-unauth/134709/1 "2018-06-05T23:47:50Z")

</div>

Hey,

I have set up filebeat with elasticsearch output. My ES instance is behind nginx reverse proxy with basic auth. I have tested my login:password with curl and everything works fine. However, I keep getting 401 unauthorized errors in my filebeat logs.

filebeat version 6.2.4 (amd64), libbeat 6.2.4

Here is my beat config:

```
filebeat.prospectors:

- type: log

  enabled: false

  paths:
    - /var/log/*.log

filebeat.config.modules:
  path: ${path.config}/modules.d/*.yml

  reload.enabled: false

setup.template.settings:
  index.number_of_shards: 3

setup.kibana:
  host: "myhost:port"
  protocol: "https"
  path: "/kibana"
  username: "login"
  password: "changeme"

output.elasticsearch:
  hosts: ["myhost:port"]
  protocol: "https"
  username: "elastic"
  password: "changeme"
  path: "/elastic"
```

---

<div class="post-metadata">

**Author:** ![d3sire](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@d3sire](https://discuss.elastic.co/u/d3sire)\
**Post date:** [June 6, 2018, 1:04pm UTC](https://discuss.elastic.co/t/filebeat-401-unauth/134709/2 "2018-06-06T13:04:55Z")

</div>

Figured out what was the problem. For anyone who will have the same problem pay attention to the path, it should exactly match the one in the nginx. I had location `/elastic/` in the nginx and path `/elastic` in the filbeat config. After nginx made a redirection to the needed path the auth header was omitted and 401 was returned as a result.

---

<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 4, 2018, 3:04pm UTC](https://discuss.elastic.co/t/filebeat-401-unauth/134709/3 "2018-07-04T15:04:59Z")

</div>

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