# No 'Access-Control-Allow-Origin' header is present on the requested resource

**URL:** https://discuss.elastic.co/t/no-access-control-allow-origin-header-is-present-on-the-requested-resource/138372
**Category:** Elasticsearch
**Created:** [July 3, 2018, 11:59am UTC](https://discuss.elastic.co/t/no-access-control-allow-origin-header-is-present-on-the-requested-resource/138372 "2018-07-03T11:59:19Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![rs123](https://avatars.discourse-cdn.com/v4/letter/r/73ab20/32.png) [@rs123](https://discuss.elastic.co/u/rs123)
#### Post date: [July 3, 2018, 11:59am UTC](https://discuss.elastic.co/t/no-access-control-allow-origin-header-is-present-on-the-requested-resource/138372/1 "2018-07-03T11:59:20Z")

</div>

Even though I have provided CORS configuration in elasticsearch.yml file as:

> http.cors.enabled: true  
> http.cors.allow-origin: "\*"

But still I'm getting this error  
`Failed to load http://localhost:9200/user/_search?pretty=true&size=100: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://00fe7e44.ngrok.io' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.`

---

<div class="post-metadata">

### Author: ![zqc0512](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zqc0512/32/32141_2.png) [@zqc0512](https://discuss.elastic.co/u/zqc0512)
#### Post date: [July 4, 2018, 7:38am UTC](https://discuss.elastic.co/t/no-access-control-allow-origin-header-is-present-on-the-requested-resource/138372/2 "2018-07-04T07:38:43Z")

</div>

> [@rs123](#):
>
> http.cors.allow-origin: "\*"

try add this  
`http.cors.allow-headers: Authorization`

---

<div class="post-metadata">

### Author: ![rs123](https://avatars.discourse-cdn.com/v4/letter/r/73ab20/32.png) [@rs123](https://discuss.elastic.co/u/rs123)
#### Post date: [July 4, 2018, 7:48am UTC](https://discuss.elastic.co/t/no-access-control-allow-origin-header-is-present-on-the-requested-resource/138372/3 "2018-07-04T07:48:50Z")

</div>

I did try this but did not work. I think my elasticsearch.yml file is not picking up. Any way I can make it use elasticsearch.yml for configuration. Looks like my elasticsearch is running on default settings irrespective of my yml file content.

---

<div class="post-metadata">

### Author: ![zqc0512](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zqc0512/32/32141_2.png) [@zqc0512](https://discuss.elastic.co/u/zqc0512)
#### Post date: [July 4, 2018, 7:51am UTC](https://discuss.elastic.co/t/no-access-control-allow-origin-header-is-present-on-the-requested-resource/138372/4 "2018-07-04T07:51:15Z")

</div>

use kibana can connect to this es?  
try use **curl** get this http: output log.

---

<div class="post-metadata">

### Author: ![rs123](https://avatars.discourse-cdn.com/v4/letter/r/73ab20/32.png) [@rs123](https://discuss.elastic.co/u/rs123)
#### Post date: [July 4, 2018, 8:16am UTC](https://discuss.elastic.co/t/no-access-control-allow-origin-header-is-present-on-the-requested-resource/138372/5 "2018-07-04T08:16:48Z")

</div>

Yes, Kibana is connecting to Elasticsearch.  
And where shoul I try curl get this http: output log.

---

<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: [August 1, 2018, 8:17am UTC](https://discuss.elastic.co/t/no-access-control-allow-origin-header-is-present-on-the-requested-resource/138372/6 "2018-08-01T08:17:00Z")

</div>

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