# Persistent nginx/discourse.conf?

**URL:** https://meta.discourse.org/t/persistent-nginx-discourse-conf/85363
**Category:** Self-hosting
**Created:** [April 15, 2018, 8:09am UTC](https://meta.discourse.org/t/persistent-nginx-discourse-conf/85363 "2018-04-15T08:09:58Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![ryanerwin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ryanerwin/32/94589_2.png) [@ryanerwin](https://meta.discourse.org/u/ryanerwin)
#### Post date: [April 15, 2018, 11:38am UTC](https://meta.discourse.org/t/persistent-nginx-discourse-conf/85363/5 "2018-04-15T11:38:29Z")

</div>

If anyone else is looking to add auth\_basic to their site during development, and make it persistent across `./launcher rebuild app` just update your `containers/app.yml` with:

```plaintext
## Any custom commands to run after building
run:
  - exec: echo "Beginning of custom commands"
  - replace:
     filename: "/etc/nginx/conf.d/discourse.conf"
     from: "# auth_basic on"
     to: "auth_basic on"
  - replace:
     filename: "/etc/nginx/conf.d/discourse.conf"
     from: "# auth_basic_user_file /etc/nginx/htpasswd"
     to: "auth_basic_user_file /etc/nginx/htpasswd"
  - file:
     path: "/etc/nginx/htpasswd"
     contents: |
      myuser:$apr1$pVrNvrxt$QvutzMrHfb2IYDNUOk54o0
     # use: `openssl passwd -apr1` to generate password hash

```

Of course update **myuser** to be the actual username you want and run `openssl passwd -apr1` to generate a hash of your real password.

Or you could install a whole separate instance of nginx and create a reverse proxy just for this… Whichever is easier for you 😉

---

_[View the full topic](https://meta.discourse.org/t/persistent-nginx-discourse-conf/85363)._
