# Use Nginx Proxy Manager to manage multiple sites with Discourse

**URL:** https://meta.discourse.org/t/use-nginx-proxy-manager-to-manage-multiple-sites-with-discourse/206344
**Category:** Sysadmins
**Tags:** how-to
**Created:** [August 17, 2021, 8:21am UTC](https://meta.discourse.org/t/use-nginx-proxy-manager-to-manage-multiple-sites-with-discourse/206344 "2021-08-17T08:21:04Z")
**Posts on this page:** 1
**Showing post:** 19

<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: [October 19, 2021, 8:39pm UTC](https://meta.discourse.org/t/use-nginx-proxy-manager-to-manage-multiple-sites-with-discourse/206344/19 "2021-10-19T20:39:58Z")

</div>

Here’s my version of this. I almost gave up, but @tophee linked to a post that I (!?) wrote that provided the necessary magic! This is now a straight-forward way to configure Nginx Proxy Manager for Discourse. I think this makes this similar to [Run other websites on the same machine as Discourse - #396](https://meta.discourse.org/t/running-other-websites-on-the-same-machine-as-discourse/17247/396).

### Install Nginx Proxy Manager per their instructions at

> **[Nginx Proxy Manager](https://nginxproxymanager.com/)**
>
> Docker container and built in Web Application for managing Nginx proxy hosts with a simple, powerful interface, providing free SSL support via Let's Encrypt

### Remove SSL and Let’s Encrypt templates:

See that these lines in your `yml` file are commented out or deleted:

```plaintext
## Uncomment these two lines if you wish to add Lets Encrypt (https)
#- "templates/web.ssl.template.yml"
#- "templates/web.letsencrypt.ssl.template.yml"

```

### Have Discourse use the `npm-default` network.

If you blindly follow the Nginx Proxy Manager install instructions, it will create a docker network called `npm_default`.

Add this stanza to your `yml` file(s). If you have separate `web_only` and `data` containers, you’ll need to add this to each of them (I didn’t test the `mail-receiver` container.). `docker_args` is not indented.

```plaintext
docker_args: |
  --network npm_default

```

### No need to expose any ports

Comment out or remove these lines from your `yml` file:

```plaintext
# expose:
# - "80:80" # http
# - "443:443" # https

```

You can then rebuild your container(s) and configure Nginx Proxy Manager like this:

![image](https://global.discourse-cdn.com/meta/original/3X/a/0/a0fd79c41d163c27e4a5d1d6683a3ab8b4bf1f8b.png)

A simple (but not necessarily recommended) way to spin up a second Discourse site would be this:

```plaintext
cd /var/discourse/containers
cp app.yml othersite.yml
# somehow edit, at a minimum, the hostname in othersite.yml
./launcher rebuild othersite

```

Then add it to NPM as above, using `othersite` instead of `app`.

I tested this with an `app.yml` plus two `web_only`-style containers and a single `data` container plus a separate `othersite-redis` container that is a copy of the `data` container containing only the redis templates. (But an easier solution would be to put the extra redis in the `web_only` container).

---

_[View the full topic](https://meta.discourse.org/t/use-nginx-proxy-manager-to-manage-multiple-sites-with-discourse/206344)._
