# Discourse\_enable\_cors

**URL:** https://meta.discourse.org/t/discourse-enable-cors/109616
**Category:** Support
**Created:** [February 20, 2019, 5:47am UTC](https://meta.discourse.org/t/discourse-enable-cors/109616 "2019-02-20T05:47:31Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![csmu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/csmu/32/124581_2.png) [@csmu](https://meta.discourse.org/u/csmu)
#### Post date: [February 20, 2019, 5:47am UTC](https://meta.discourse.org/t/discourse-enable-cors/109616/1 "2019-02-20T05:47:31Z")

</div>

Can DISCOURSE\_ENABLE\_CORS be set on a running discourse self-hosted site without rebuilding the app image?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [February 20, 2019, 1:03pm UTC](https://meta.discourse.org/t/discourse-enable-cors/109616/2 "2019-02-20T13:03:57Z")

</div>

I don’t think that the environment variable is used in the rebuild, so you should be able to do this:

```
./launcher destroy app
./launcher start app

```

You can do it on a single line with a ; between the two commands. Your site will be down for about a minute while the new container starts up.

---

<div class="post-metadata">

### Author: ![csmu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/csmu/32/124581_2.png) [@csmu](https://meta.discourse.org/u/csmu)
#### Post date: [February 21, 2019, 3:28am UTC](https://meta.discourse.org/t/discourse-enable-cors/109616/4 "2019-02-21T03:28:24Z")

</div>

Looks like that failed to change.

```plaintext
/var/discourse/launcher destroy app;/var/discourse/launcher start app 

+ /usr/bin/docker stop -t 10 app

app

+ /usr/bin/docker rm app

app

 ./launcher enter app

app:/var/www/discourse# echo $DISCOURSE_ENABLE_CORS

true

```

---

<div class="post-metadata">

### Author: ![csmu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/csmu/32/124581_2.png) [@csmu](https://meta.discourse.org/u/csmu)
#### Post date: [February 21, 2019, 8:31am UTC](https://meta.discourse.org/t/discourse-enable-cors/109616/5 "2019-02-21T08:31:58Z")

</div>

> [@csmu](#):
>
> Can DISCOURSE\_ENABLE\_CORS be set on a running discourse self-hosted site without rebuilding the app image?

Ended up doing a rebuild.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [February 21, 2019, 1:05pm UTC](https://meta.discourse.org/t/discourse-enable-cors/109616/6 "2019-02-21T13:05:32Z")

</div>

If it’s the downtime that’s bumming you out, you should move to a two container setup so that downtime is under a minute. I currently [charge a premium for this](https://www.literatecomputing.com/product/switch-discourse-to-two-container-configuration/) but may have a less expensive offering in the next month.

---

<div class="post-metadata">

### Author: ![csmu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/csmu/32/124581_2.png) [@csmu](https://meta.discourse.org/u/csmu)
#### Post date: [February 21, 2019, 8:21pm UTC](https://meta.discourse.org/t/discourse-enable-cors/109616/7 "2019-02-21T20:21:53Z")

</div>

> [@pfaffman](#):
>
> but may have a less expensive offering in the next month.

Cool 🙂

The downtime is a slight hassle and I was wondering about doing a build on a different device and moving that image over.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [February 21, 2019, 8:48pm UTC](https://meta.discourse.org/t/discourse-enable-cors/109616/8 "2019-02-21T20:48:18Z")

</div>

That’s sort-of what the two-container thing does. It leaves the old web container running while it builds the new one (and migrates the database and such). When the new image is built, you destroy the old image and crank up the new one. Down time is about a minute.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [March 23, 2019, 8:48pm UTC](https://meta.discourse.org/t/discourse-enable-cors/109616/9 "2019-03-23T20:48:27Z")

</div>

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