# Setup Multisite Configuration with Let's Encrypt and no Reverse Proxy

**URL:** https://meta.discourse.org/t/setup-multisite-configuration-with-lets-encrypt-and-no-reverse-proxy/175285
**Category:** Sysadmins
**Tags:** how-to, domains
**Created:** [January 6, 2021, 4:52pm UTC](https://meta.discourse.org/t/setup-multisite-configuration-with-lets-encrypt-and-no-reverse-proxy/175285 "2021-01-06T16:52:21Z")
**Posts on this page:** 1
**Showing post:** 25

<div class="post-metadata">

### Author: ![kcahtoor](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@kcahtoor](https://meta.discourse.org/u/kcahtoor)
#### Post date: [August 27, 2026, 11:12am UTC](https://meta.discourse.org/t/setup-multisite-configuration-with-lets-encrypt-and-no-reverse-proxy/175285/25 "2026-08-27T11:12:24Z")

</div>

I think it better to use for loop for databases. It is little bit cleaner.

```yaml
hooks:
  after_postgres:
    - exec: |
        for db in two_db thirdsite_db; do
          sudo -u postgres createdb "$db" || true
          sudo -u postgres psql "$db" -c "grant all privileges on database $db to discourse;"
          sudo -u postgres psql "$db" -c "alter schema public owner to discourse;"
          sudo -u postgres psql "$db" -c "create extension if not exists hstore;"
          sudo -u postgres psql "$db" -c "create extension if not exists pg_trgm;"
        done

```

---

_[View the full topic](https://meta.discourse.org/t/setup-multisite-configuration-with-lets-encrypt-and-no-reverse-proxy/175285)._
