# Discourse Multisite – Nginx (Dentro Docker) Serve Solo il Sito Predefinito

**URL:** https://meta.discourse.org/t/discourse-multisite-nginx-inside-docker-only-serving-default-site/357992
**Category:** Support
**Created:** [19 Marzo 2025, 4:16pm UTC](https://meta.discourse.org/t/discourse-multisite-nginx-inside-docker-only-serving-default-site/357992 "2025-03-19T16:16:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Abdelrahman\_MoHamed](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/abdelrahman_mohamed/32/467712_2.png) [@Abdelrahman\_MoHamed](https://meta.discourse.org/u/Abdelrahman_MoHamed)
#### Post date: [19 Marzo 2025, 4:16pm UTC](https://meta.discourse.org/t/discourse-multisite-nginx-inside-docker-only-serving-default-site/357992/1 "2025-03-19T16:16:37Z")

</div>

Ciao a tutti,

Sto configurando **Discourse multisite** utilizzando **[discourse\_docker](https://meta.discourse.org/t/multisite-configuration-with-docker/14084)**, ma sto riscontrando problemi con Nginx all’interno del container. Ho seguito la documentazione ufficiale, ma non riesco a far funzionare correttamente tutti i siti.

### **Risultati finora:**

- **Nginx all’interno dell’immagine Docker di Discourse** sta **servendo solo il sito predefinito** – i siti aggiuntivi non vengono caricati.

- Quando **disabilito Let’s Encrypt** e abilito il **proxy di Cloudflare** , **tutti i siti diventano inaccessibili**.

- Ho controllato la configurazione multisite di `app.yml` e ricostruito il container, ma il problema persiste.

### Ecco la configurazione attuale

```plaintext
templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  - "templates/web.ratelimited.template.yml"
  - "templates/web.ssl.template.yml"

expose:
  - "80:80"
  - "443:443"

params:
  db_default_text_search_config: "pg_catalog.english"
  db_shared_buffers: "256MB"

env:
  LC_ALL: en_US.UTF-8
  LANG: en_US.UTF-8
  LANGUAGE: en_US.UTF-8
  UNICORN_WORKERS: 4
  DISCOURSE_MAX_ADMIN_API_REQS_PER_KEY_PER_MINUTE: 5000
  DISCOURSE_MAX_REQS_PER_IP_PER_MINUTE: 5000
  DISCOURSE_HOSTNAME: forum.getnursingjobs.com
  DISCOURSE_DB_USERNAME: discourse
  DISCOURSE_DB_PASSWORD: "REPLACE_WITH_ENV_VAR"
  DISCOURSE_DB_HOST: DB IP
  DISCOURSE_DB_NAME:
  DOCKER_USE_HOSTNAME: true
  DISCOURSE_DEVELOPER_EMAILS:
  DISCOURSE_SMTP_ADDRESS:
  DISCOURSE_SMTP_PORT:
  DISCOURSE_SMTP_USER_NAME:
  DISCOURSE_SMTP_PASSWORD: "REPLACE_WITH_ENV_VAR"
  DISCOURSE_NOTIFICATION_EMAIL:
  DISCOURSE_REPLY_BY_EMAIL_ADDRESS:
  DISCOURSE_MAXMIND_ACCOUNT_ID:
  DISCOURSE_MAXMIND_LICENSE_KEY: "REPLACE_WITH_ENV_VAR"
  DISCOURSE_EMAIL_SITE_TITLE: 'GetNursingJobs.com'

volumes:
  - volume:
      host: /var/discourse/shared/standalone
      guest: /shared
  - volume:
      host: /var/discourse/shared/standalone/log/var-log
      guest: /var/log

hooks:
  after_postgres:
    - exec: sudo -u postgres createdb b_discourse || exit 0
    - exec:
        stdin: |
          grant all privileges on database b_discourse to discourse;
        cmd: sudo -u postgres psql b_discourse
        raise_on_fail: false
    - exec: /bin/bash -c 'sudo -u postgres psql b_discourse <<<' "alter schema public owner to discourse;"
    - exec: /bin/bash -c 'sudo -u postgres psql b_discourse <<<' "create extension if not exists hstore;"
    - exec: /bin/bash -c 'sudo -u postgres psql b_discourse <<<' "create extension if not exists pg_trgm;"

  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - mkdir -p plugins
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-adplugin.git
          - git clone https://github.com/discourse/discourse-google-one-tap.git

  before_bundle_exec:
    - file:
        path: $home/config/multisite.yml
        contents: |
          welding:
            adapter: postgresql
            database: discourse_welding
            username: discourse
            password: "REPLACE_WITH_ENV_VAR"
            host: DB IP
            pool: 25
            timeout: 5000
            db_id: 2
            host_names:
              - forum.getweldingjobs.com
          medical:
            adapter: postgresql
            database: discourse_medical
            username: discourse
            password: "REPLACE_WITH_ENV_VAR"
            host: DB IP
            pool: 25
            timeout: 5000
            db_id: 3
            host_names:
              - forum.medicaltranscriptionjobs.com
          dataentry:
            adapter: postgresql
            database: discourse_dataentry
            username: discourse
            password: "REPLACE_WITH_ENV_VAR"
            host: DB IP
            pool: 25
            timeout: 5000
            db_id: 4
            host_names:
              - forum.dataentryjobs.com
          chef:
            adapter: postgresql
            database: discourse_chef
            username: discourse
            password: "REPLACE_WITH_ENV_VAR"
            host: DB IP
            pool: 25
            timeout: 5000
            db_id: 5
            host_names:
              - forum.getchefjobs.com

  after_bundle_exec:
    - exec: cd /var/www/discourse &amp;&amp; sudo -E -u discourse bundle exec rake multisite:migrate

```

### Di cosa ho bisogno di aiuto:

1. Come posso configurare Nginx interno al container per servire tutti i domini multisite?
2. Ci sono impostazioni specifiche di `app.yml` che devo modificare per questa configurazione?

---

<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: [19 Marzo 2025, 10:24pm UTC](https://meta.discourse.org/t/discourse-multisite-nginx-inside-docker-only-serving-default-site/357992/3 "2025-03-19T22:24:51Z")

</div>

Credo che i problemi fossero la nuvola arancione e l’uso di nomi host errati.
