# Where to place the CORS file

**URL:** <https://discuss.elastic.co/t/where-to-place-the-cors-file/27685>\
**Category:** Elasticsearch\
**Created:** [August 19, 2015, 3:09pm UTC](https://discuss.elastic.co/t/where-to-place-the-cors-file/27685 "2015-08-19T15:09:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dcistaro](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@dcistaro](https://discuss.elastic.co/u/dcistaro)\
**Post date:** [August 19, 2015, 3:09pm UTC](https://discuss.elastic.co/t/where-to-place-the-cors-file/27685/1 "2015-08-19T15:09:03Z")

</div>

I am following the elasticsearch-angular-example by Spence Spalger. The text says to place the CORS file near the config file. But I do not see a config file, just a config directory with 2 YAML files. So where does the CORS file go? Asa YAML file in the config directory?

Thanks for the help..

http.cors:  
enabled: true  
allow-origin: /https?://localhost(:[0-9]+)?/

---

<div class="post-metadata">

**Author:** ![pemontto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pemontto/32/3908_2.png) [@pemontto](https://discuss.elastic.co/u/pemontto)\
**Post date:** [August 19, 2015, 4:55pm UTC](https://discuss.elastic.co/t/where-to-place-the-cors-file/27685/2 "2015-08-19T16:55:33Z")

</div>

The settings go in your elasticsearch.yml file. See the CORS settings in the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-http.html)

---

<div class="post-metadata">

**Author:** ![dcistaro](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@dcistaro](https://discuss.elastic.co/u/dcistaro)\
**Post date:** [August 19, 2015, 6:13pm UTC](https://discuss.elastic.co/t/where-to-place-the-cors-file/27685/3 "2015-08-19T18:13:45Z")

</div>

Thank you.. The elasticsearch.yaml file as downloaded only contains comments. Can I delete all and those and insert the CORS text?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [August 19, 2015, 6:25pm UTC](https://discuss.elastic.co/t/where-to-place-the-cors-file/27685/4 "2015-08-19T18:25:06Z")

</div>

Yes you can.

But often, you want to define `cluster.name` at least.

---

<div class="post-metadata">

**Author:** ![dcistaro](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@dcistaro](https://discuss.elastic.co/u/dcistaro)\
**Post date:** [August 19, 2015, 6:28pm UTC](https://discuss.elastic.co/t/where-to-place-the-cors-file/27685/5 "2015-08-19T18:28:34Z")

</div>

Thanks David .. I will read the documentation and define the cluster name there as well.

---

<div class="post-metadata">

**Author:** ![dcistaro](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@dcistaro](https://discuss.elastic.co/u/dcistaro)\
**Post date:** [August 26, 2015, 2:01pm UTC](https://discuss.elastic.co/t/where-to-place-the-cors-file/27685/6 "2015-08-26T14:01:35Z")

</div>

Thank you .. this worked .. you knew it would ! The example ran fine when I  
started elasticsearch.bat on my local drive

Another question. .. I am a real newbie at web development. I deploy an app  
to firebase. How do I get firebase to run elasticsearch?

Thanks,

Don.

---

<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 5, 2017, 11:53pm UTC](https://discuss.elastic.co/t/where-to-place-the-cors-file/27685/7 "2017-07-05T23:53:44Z")

</div>


