# ElasticSearch HTTP CORS config variables are not being honored

**URL:** <https://discuss.elastic.co/t/elasticsearch-http-cors-config-variables-are-not-being-honored/164709>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [January 17, 2019, 10:28pm UTC](https://discuss.elastic.co/t/elasticsearch-http-cors-config-variables-are-not-being-honored/164709 "2019-01-17T22:28:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MantasVidutis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mantasvidutis/32/39902_2.png) [@MantasVidutis](https://discuss.elastic.co/u/MantasVidutis)\
**Post date:** [January 17, 2019, 10:28pm UTC](https://discuss.elastic.co/t/elasticsearch-http-cors-config-variables-are-not-being-honored/164709/1 "2019-01-17T22:28:15Z")

</div>

I have an ElasticSearch node that is coming up in a docker-compose cluster locally.

This is the dockerfile:

```
FROM docker.elastic.co/elasticsearch/elasticsearch:6.5.4

ADD elasticsearch.yml config/elasticsearch.yml

```

And this is the elasticsearch.yml:

```
cluster.name: "docker-cluster"
network.host: 0.0.0.0

# minimum_master_nodes need to be explicitly set when bound on a public IP
# set to 1 to allow single node clusters
# Details: https://github.com/elastic/elasticsearch/pull/17288
discovery.zen.minimum_master_nodes: 1
discovery.type: single-node
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-methods: OPTIONS, HEAD, GET, POST, PUT, DELETE
http.cors.allow-headers: X-Requested-With, X-Auth-Token, Content-Type, Content-Length
http.cors.allow-credentials: true

```

I have verified that the configuration file is in the docker instance.

However, when I provide an Origin header in a request to the node (from an origin that is not the node), it returns a 403 forbidden. When trying from a javascript client, I get  
`Access to XMLHttpRequest at '[http://localhost:9200/'](http://localhost:9200/%27) from origin 'http://localhost:8005' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.`

I can't find any documentation in ElasticSearch docs about something I should be doing differently. What am I doing wrong?

---

<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:** [February 14, 2019, 10:28pm UTC](https://discuss.elastic.co/t/elasticsearch-http-cors-config-variables-are-not-being-honored/164709/2 "2019-02-14T22:28:20Z")

</div>

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