Hallo zusammen,
ich richte Discourse Multisite mit discourse_docker ein, habe aber Probleme mit Nginx innerhalb des Containers. Ich habe die offizielle Dokumentation befolgt, aber es gelingt mir nicht, alle Websites korrekt zum Laufen zu bringen.
Bisherige Erkenntnisse:
- Der Nginx innerhalb des Discourse Docker-Images liefert nur die Standard-Website – zusätzliche Websites werden nicht geladen.
I, [2025-03-19T03:38:06.444387 #1] INFO -- : Replacing (?-mix:server.+{) with server {
listen 80;
return 301 https://$$ENV_DISCOURSE_HOSTNAME$request_uri;
}
- Wenn ich Let’s Encrypt deaktiviere und den Cloudflare-Proxy aktiviere, werden alle Websites unzugänglich.
- Ich habe die Multisite-Konfiguration in
app.ymlüberprüft und den Container neu erstellt, aber das Problem besteht weiterhin.
Hier ist die aktuelle Konfiguration
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 && sudo -E -u discourse bundle exec rake multisite:migrate
Wobei ich Hilfe brauche:
- Wie kann ich den internen Nginx innerhalb des Containers konfigurieren, um alle Multisite-Domains zu bedienen?
- Gibt es spezifische
app.yml-Einstellungen, die ich für dieses Setup anpassen muss?