# Настройка Let's Encrypt для второго домена в существующей установке Discourse

**URL:** https://meta.discourse.org/t/set-up-lets-encrypt-with-second-domain-for-existing-discourse-install/356661
**Category:** Support
**Tags:** letsencrypt
**Created:** [10.Март.2025 17:14:41 UTC](https://meta.discourse.org/t/set-up-lets-encrypt-with-second-domain-for-existing-discourse-install/356661 "2025-03-10T17:14:41Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![oppman](https://avatars.discourse-cdn.com/v4/letter/o/aca169/32.png) [@oppman](https://meta.discourse.org/u/oppman)
#### Post date: [10.Март.2025 17:14:41 UTC](https://meta.discourse.org/t/set-up-lets-encrypt-with-second-domain-for-existing-discourse-install/356661/1 "2025-03-10T17:14:41Z")

</div>

У меня уже есть установленный самостоятельно экземпляр Discourse, настроенный с использованием HTTPS.

[https://community.old.domain](https://community.old.domain) работает

Я хочу настроить [https://community.new.domain](https://community.new.domain)

Я забыл, как именно настраивал Discourse изначально. Мои вопросы:

1. Где нужно запускать Let’s Encrypt? Есть ли специальный скрипт, или мне нужно установить certbot и python3-certbot-nginx где-то ещё? Я не знаком с Docker, поэтому мне нужен рецепт или пошаговая инструкция, если это нужно выполнять в Docker.
2. После получения сертификата, как добавить его в конфигурацию nginx?

Я меняю название сообщества с old.domain на new.domain. Надеюсь, что ссылки на old.domain продолжат работать.

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [10.Март.2025 23:15:02 UTC](https://meta.discourse.org/t/set-up-lets-encrypt-with-second-domain-for-existing-discourse-install/356661/3 "2025-03-10T23:15:02Z")

</div>

Ознакомьтесь с этими руководствами:

> [@Change the domain name or rename your Discourse](https://meta.discourse.org/t/change-the-domain-name-or-rename-your-discourse/16098):
>
> bookmark This guide explains how-to change the domain name of your Discourse site, and includes information about setting up DNS changes, editing configuration files, updating site settings, and correcting social logins and post content to reflect your new domain name. warning This guide is for self-hosted Discourse instances that were installed using our [installation guide on GitHub](https://github.com/discourse/discourse/blob/main/docs/INSTALL-cloud.md). If you are [hosted by Discourse](https://www.discourse.org/pricing), please see [Configure your domain name for hosted Discourse](https://meta.discourse.org/t/configure-your-domain-name-for-hosted-discourse/21827) for specific …

> [@Set up HTTPS support with Let's Encrypt](https://meta.discourse.org/t/set-up-https-support-with-lets-encrypt/40709):
>
> bookmark This is a guide for enabling HTTPS on an existing Discourse installation using Let’s Encrypt. It assumes prior installation without HTTPS enabled. person_raising_hand Required user level: System Administrator exclamation This guide is only for existing installs where HTTPS is not enabled. Following the [official setup guide](https://github.com/discourse/discourse/blob/main/docs/INSTALL-cloud.md) automatically enables HTTPS by default. So you’d like to add https to your Discourse absolutely free, courtesy of our friends at [Let’s Encrypt?](https://letsencrypt.org/)bell I…

---

<div class="post-metadata">

### Author: ![oppman](https://avatars.discourse-cdn.com/v4/letter/o/aca169/32.png) [@oppman](https://meta.discourse.org/u/oppman)
#### Post date: [11.Март.2025 00:42:47 UTC](https://meta.discourse.org/t/set-up-lets-encrypt-with-second-domain-for-existing-discourse-install/356661/4 "2025-03-11T00:42:47Z")

</div>

Спасибо за вашу помощь. Если я пройду эти шаги, старый домен перестанет работать сразу?

Я беспокоюсь, что ссылки на старый домен перестанут работать. Их очень много. Люди больше знакомы со старым доменом.

Я хочу использовать старый домен и новый домен одновременно в течение месяца или двух. Это возможно?

---

<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: [11.Март.2025 02:17:43 UTC](https://meta.discourse.org/t/set-up-lets-encrypt-with-second-domain-for-existing-discourse-install/356661/5 "2025-03-11T02:17:43Z")

</div>

Где-то есть тема о том, как добавить второй домен в сертификат Let’s Encrypt. Я не могу её найти, но именно это вам нужно.

---

<div class="post-metadata">

### Author: ![oppman](https://avatars.discourse-cdn.com/v4/letter/o/aca169/32.png) [@oppman](https://meta.discourse.org/u/oppman)
#### Post date: [11.Март.2025 05:00:23 UTC](https://meta.discourse.org/t/set-up-lets-encrypt-with-second-domain-for-existing-discourse-install/356661/6 "2025-03-11T05:00:23Z")

</div>

Спасибо. Возможно, вы имели в виду эти?

> [@Set up Let’s Encrypt with multiple domains / redirects](https://meta.discourse.org/t/set-up-let-s-encrypt-with-multiple-domains-redirects/56685?u=oppman):
>
> NOTE: @pfaffman says: This page needs to be cleaned up. There is now a new ENV setting that will let you add more hostnames. In your app.yml under your DISCOURSE\_HOSTNAME line (it can go many places but that one makes sense), add DISCOURSE\_HOSTNAME\_ALIASES: domain.com,other.domain.com and early reports suggest that you’ll get valid certs for those domains and that accessing https://domain.com will properly redirect you to your DISCOURSE\_HOSTNAME without a certificate error. If you do that an…

> [@Let's Encrypte with multiple domains wasn't working for ECC certs](https://meta.discourse.org/t/lets-encrypte-with-multiple-domains-wasnt-working-for-ecc-certs/328109?u=oppman):
>
> How do I initiate the renewal of the certificate, simply delete the old one from /shared/ssl?

Они выглядят довольно сложными. Мне, возможно, придется завести другой домен и протестировать настройки на внутренней установке Discourse в другой компании, прежде чем применять их на крупном публичном сайте.

---

<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: [11.Март.2025 19:46:04 UTC](https://meta.discourse.org/t/set-up-lets-encrypt-with-second-domain-for-existing-discourse-install/356661/7 "2025-03-11T19:46:04Z")

</div>

> [@oppman](#):
>
> Это выглядит довольно сложно.

Что ж, я приложил немало усилий, чтобы вы могли сгенерировать текст для вставки в свой файл yml.

Другой способ — просто оставить сервер на старом домене с действительным сертификатом, который будет выполнять перенаправления.
