# לאן עלי ללכת כדי להגדיר את משתנה הסביבה \`DISCOURSE\_ENABLE\_CORS\`?

**URL:** <https://meta.discourse.org/t/where-i-should-go-to-set-the-discourse-enable-cors-env-variable/249632>\
**Category:** Product Support\
**Created:** [21 בדצמבר,‏ 2022,‏ 11:45pm UTC](https://meta.discourse.org/t/where-i-should-go-to-set-the-discourse-enable-cors-env-variable/249632 "2022-12-21T23:45:30Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![mikeguo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mikeguo/32/278830_2.png) [@mikeguo](https://meta.discourse.org/u/mikeguo)\
**Post date:** [27 בדצמבר,‏ 2022,‏ 1:45am UTC](https://meta.discourse.org/t/where-i-should-go-to-set-the-discourse-enable-cors-env-variable/249632/15 "2022-12-27T01:45:11Z")

</div>

Thank you very much for your detailed explanation.  
`https://algo.monster` is my website that I want to embed Discourse in. Specifically speaking,  
embed Discourse in article page to display comments, and replace `Cusdis` I’m using. For example,  
the article `https://algo.monster/problems/math-basics`, and comments:

 ![image](https://global.discourse-cdn.com/meta/original/4X/9/0/f/90f6978955d02a056ef90c334ff1e975478f0f2f.png)  
My website `https://algo.monster` doesn’t use a blogging platform, neither Wordpress nor Ghost. My website is implemented by my own code and deployed on my own cloud server.  
Using the codes that are provided on `/admin/customize/embedding`, embedded Discourse are shown correctly.  
The problem I hope to solve by configuring `DISCOURSE_ENABLE_CORS` is as below:

> [@mikeguo](#):
>
> I’m using Discourse hosted instance and going to embed Discourse to my website, and when I try to get `contentDoument` object of the iframe of embedded Discourse, I found the cross origin limit. In admin setting page, I noticed there is the “cors origins” setting as shown in the topic picture. Then I add my testing origin url, but not worked. And I noticed the tip that is `The DISCOURSE_ENABLE_CORS env variable must be set to true to enable CORS.` However, I can’t find where to set DISCOURSE\_ENABLE\_CORS in admin settings.  
> I want to know how to set DISCOURSE\_ENABLE\_CORS, or if my cross-domain configuration is not working, is it related to this setting.

> [@denvergeeks](#):
>
> [https://e53c-185-143-220-5.eu.ngrok.io/](https://e53c-185-143-220-5.eu.ngrok.io/)

This url is the one I’m using for testing and should not cause cross-origin issues.

---

_[View the full topic](https://meta.discourse.org/t/where-i-should-go-to-set-the-discourse-enable-cors-env-variable/249632)._
