# How to password protect staging environment?

**URL:** <https://meta.discourse.org/t/how-to-password-protect-staging-environment/161641>\
**Category:** Self-hosting\
**Created:** [August 21, 2020, 9:25am UTC](https://meta.discourse.org/t/how-to-password-protect-staging-environment/161641 "2020-08-21T09:25:00Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [August 21, 2020, 9:29am UTC](https://meta.discourse.org/t/how-to-password-protect-staging-environment/161641/2 "2020-08-21T09:29:40Z")

</div>

There is no apache, but NGINX is running inside the Discourse container. This topic may help:

> [@Persistent nginx/discourse.conf?](https://meta.discourse.org/t/persistent-nginx-discourse-conf/85363/5):
>
> 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: ## 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/htpa…

---

_[View the full topic](https://meta.discourse.org/t/how-to-password-protect-staging-environment/161641)._
