# Elastic 401 error with xpack security off

**URL:** <https://discuss.elastic.co/t/elastic-401-error-with-xpack-security-off/250085>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [September 27, 2020, 12:48pm UTC](https://discuss.elastic.co/t/elastic-401-error-with-xpack-security-off/250085 "2020-09-27T12:48:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jividi](https://avatars.discourse-cdn.com/v4/letter/j/ecccb3/32.png) [@jividi](https://discuss.elastic.co/u/jividi)\
**Post date:** [September 27, 2020, 12:48pm UTC](https://discuss.elastic.co/t/elastic-401-error-with-xpack-security-off/250085/1 "2020-09-27T12:48:02Z")

</div>

Hi, I have an elastic 7.8 on docker that I want to connect to it from a remote server on the internet with the domain, I have several other local vms that connects to logstash and logstash works fine with local IP but I need this server to connect directly to elastic through the internet, my problem is that I can't see the elastic API.  
Xpack security is off but I get 401 error as below:

```auto
curl -XGET 'http:// ****.***.**:29200/_cluster/health'
{"error":{"root_cause":[{"type":"security_exception","reason":"missing authentication credentials for REST request [/_cluster/health]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}}],"type":"security_exception","reason":"missing authentication credentials for REST request [/_cluster/health]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}},"status":401}

```

There is no log on elastic related to this error.  
We have a gw that translate the domain:29200 to local-ip:9200  
here is my elastic config:

```auto
cluster.name: ****
node.name: "elasticsearch"
node.master: true
node.data: true
network.host: 0.0.0.0
http.host: 0.0.0.0
xpack.license.self_generated.type: basic
xpack.monitoring.enabled: true
xpack.security.enabled: false
xpack.security.audit.enabled: true
xpack.monitoring.exporters.my_local:
   type: local
use_ingest: false

```

---

<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:** [October 25, 2020, 12:48pm UTC](https://discuss.elastic.co/t/elastic-401-error-with-xpack-security-off/250085/2 "2020-10-25T12:48:04Z")

</div>

Closed on October 25, 2020, 12:48pm UTC

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