# How can I update nginx.conf without resetting it on rebuild?

**URL:** <https://meta.discourse.org/t/how-can-i-update-nginx-conf-without-resetting-it-on-rebuild/48102>\
**Category:** Self-hosting\
**Created:** [2 أغسطس 2016، 6:01ص UTC](https://meta.discourse.org/t/how-can-i-update-nginx-conf-without-resetting-it-on-rebuild/48102 "2016-08-02T06:01:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![markm1](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@markm1](https://meta.discourse.org/u/markm1)\
**Post date:** [2 أغسطس 2016، 6:01ص UTC](https://meta.discourse.org/t/how-can-i-update-nginx-conf-without-resetting-it-on-rebuild/48102/1 "2016-08-02T06:01:28Z")

</div>

Hi,

I have a question - How can I update nginx.conf or discourse.conf without having it reset when the container is rebuilt?

I edit the file using nano, save it. But when I rebuild the app, the original file is there instead of the updated one. Can someone help please? 😳

---

<div class="post-metadata">

**Author:** ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)\
**Post date:** [2 أغسطس 2016، 6:05ص UTC](https://meta.discourse.org/t/how-can-i-update-nginx-conf-without-resetting-it-on-rebuild/48102/2 "2016-08-02T06:05:59Z")

</div>

You have to use `replace` commands in your `app.yml` to make the edits to the config files as part of the build process. There’s [lots of examples in the `discourse_docker` repo](https://github.com/discourse/discourse_docker/search?utf8=%E2%9C%93&q=replace).

---

<div class="post-metadata">

**Author:** ![markm1](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@markm1](https://meta.discourse.org/u/markm1)\
**Post date:** [4 أغسطس 2016، 6:08ص UTC](https://meta.discourse.org/t/how-can-i-update-nginx-conf-without-resetting-it-on-rebuild/48102/3 "2016-08-04T06:08:58Z")

</div>

@mpalmer Thank you so much! That solved my issue. I will try and learn more about formatting through yml.

I have just one more question if you can - which file do I need to replace the repo links in if I am using a custom repo of discourse? Is the default repo hardcoded in any conf file?

Thanks!

---

<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:** [19 فبراير 2019، 9:30ص UTC](https://meta.discourse.org/t/how-can-i-update-nginx-conf-without-resetting-it-on-rebuild/48102/4 "2019-02-19T09:30:50Z")

</div>



---

<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:** [15 مارس 2022، 11:20ص UTC](https://meta.discourse.org/t/how-can-i-update-nginx-conf-without-resetting-it-on-rebuild/48102/5 "2022-03-15T11:20:32Z")

</div>



---

<div class="post-metadata">

**Author:** ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)\
**Post date:** [15 مارس 2022، 11:26ص UTC](https://meta.discourse.org/t/how-can-i-update-nginx-conf-without-resetting-it-on-rebuild/48102/6 "2022-03-15T11:26:33Z")

</div>


