# After activating HTTPS Discourse doesn´t work

**URL:** https://meta.discourse.org/t/after-activating-https-discourse-doesn-t-work/206907
**Category:** Self-hosting
**Created:** [October 24, 2021, 5:45pm UTC](https://meta.discourse.org/t/after-activating-https-discourse-doesn-t-work/206907 "2021-10-24T17:45:38Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![ITAS-Isti](https://avatars.discourse-cdn.com/v4/letter/i/87869e/32.png) [@ITAS-Isti](https://meta.discourse.org/u/ITAS-Isti)
#### Post date: [October 24, 2021, 5:45pm UTC](https://meta.discourse.org/t/after-activating-https-discourse-doesn-t-work/206907/1 "2021-10-24T17:45:38Z")

</div>

Hallo,

after activating Lets Enrypt Templates and rebuilding Discourse nothing works:

NGINX gives a cryptical error:

 ![image](https://global.discourse-cdn.com/meta/original/3X/4/7/478398bb67360f3c8a89842c4ca727db0a751983.jpeg)

The strange thing is: there is no nginx directory in /ETC

These templates are active:

 ![image](https://global.discourse-cdn.com/meta/original/3X/d/3/d3106ac0ef04618b9f71703f6ffa542781b8a916.jpeg)

These are the settings, the app has been rebuilt with

 ![image](https://global.discourse-cdn.com/meta/original/3X/7/1/7114f3781c61b8dd9cddc0fd7de892a286a25c56.jpeg)

What can be the reason of this issues?  
I think the cert should be issued for the hostname: [discourse.itas-karlsruhe.de](http://discourse.itas-karlsruhe.de)

I have already checked with the launcher if the app really runs … Yeah, it does run …

I.

---

<div class="post-metadata">

### Author: ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)
#### Post date: [October 24, 2021, 5:59pm UTC](https://meta.discourse.org/t/after-activating-https-discourse-doesn-t-work/206907/2 "2021-10-24T17:59:16Z")

</div>

you seem to be in your home directory (~) when you `cd etc`  
`cd /etc/nginx` should work

---

<div class="post-metadata">

### Author: ![ITAS-Isti](https://avatars.discourse-cdn.com/v4/letter/i/87869e/32.png) [@ITAS-Isti](https://meta.discourse.org/u/ITAS-Isti)
#### Post date: [October 24, 2021, 6:05pm UTC](https://meta.discourse.org/t/after-activating-https-discourse-doesn-t-work/206907/3 "2021-10-24T18:05:52Z")

</div>

No, I have checked it in the correct directory:

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/f/5fd12bd5538e4bf20c30066537c4fc3678588246.jpeg)

---

<div class="post-metadata">

### Author: ![Simon\_Manning](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon_manning/32/198596_2.png) [@Simon\_Manning](https://meta.discourse.org/u/Simon_Manning)
#### Post date: [October 24, 2021, 6:17pm UTC](https://meta.discourse.org/t/after-activating-https-discourse-doesn-t-work/206907/4 "2021-10-24T18:17:04Z")

</div>

If this is a standard Docker install, you’ll also need to enter the app first.

```plaintext
cd /var/discourse
./launcher enter app

```

Assuming that succeeds, you can print line 46 of the config file with sed:

```plaintext
sed -n '46p' /etc/nginx/conf.d/discourse.conf

```

With the same templates as you and no specific modifications to that config file, I see this:

```plaintext
  return 301 https://discourse.softpress.com$request_uri;

```

---

<div class="post-metadata">

### Author: ![ITAS-Isti](https://avatars.discourse-cdn.com/v4/letter/i/87869e/32.png) [@ITAS-Isti](https://meta.discourse.org/u/ITAS-Isti)
#### Post date: [October 24, 2021, 6:21pm UTC](https://meta.discourse.org/t/after-activating-https-discourse-doesn-t-work/206907/5 "2021-10-24T18:21:16Z")

</div>

> [@Simon\_Manning](#):
>
> `sed -n '46p' /etc/nginx/conf.d/discourse.conf`

Thank you.  
I have found as follows:

![image](https://global.discourse-cdn.com/meta/optimized/3X/b/e/be7523925c709c468c5eab552fe76a66f3dfa775_2_690x88.png)

As you see the field “Discourse hostname” is filled in app.yml:

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/d/ed1248f6e27b4b6eb6d1e30c8aafadb8122f64ac.jpeg)

---

<div class="post-metadata">

### Author: ![Simon\_Manning](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon_manning/32/198596_2.png) [@Simon\_Manning](https://meta.discourse.org/u/Simon_Manning)
#### Post date: [October 24, 2021, 6:32pm UTC](https://meta.discourse.org/t/after-activating-https-discourse-doesn-t-work/206907/6 "2021-10-24T18:32:16Z")

</div>

Looks like it’s failing to substitute the hostname for some reason but I’m not sure why that might be. When you rebuilt Discourse, did you do it by running these commands?

```plaintext
cd /var/discourse
./launcher rebuild app

```

The only difference I can see between what you and I have is the use of a hyphen in the domain name but I would be very surprised if that would cause a problem.

---

<div class="post-metadata">

### Author: ![ITAS-Isti](https://avatars.discourse-cdn.com/v4/letter/i/87869e/32.png) [@ITAS-Isti](https://meta.discourse.org/u/ITAS-Isti)
#### Post date: [October 24, 2021, 6:41pm UTC](https://meta.discourse.org/t/after-activating-https-discourse-doesn-t-work/206907/7 "2021-10-24T18:41:35Z")

</div>

Yeah, this is how I have rebuilt the app …

After rebuild seems everythin to work:

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/b/eb4c6865b303290c9e59183d66cca7fba2c9c55f.jpeg)

---

<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 25, 2021, 12:25pm UTC](https://meta.discourse.org/t/after-activating-https-discourse-doesn-t-work/206907/8 "2021-10-25T12:25:27Z")

</div>

If you rebuilt a bunch of times then you hit the let’s encrypt rate limits.

There is no nginx on the server, it’s inside the discourse container. That’s why you can’t find it.

> [@ITAS-Isti](#):
>
> After rebuild seems everythin to work:

So you solved your problem by rebuilding?

You should mark that post as the solution.

---

<div class="post-metadata">

### Author: ![ITAS-Isti](https://avatars.discourse-cdn.com/v4/letter/i/87869e/32.png) [@ITAS-Isti](https://meta.discourse.org/u/ITAS-Isti)
#### Post date: [October 25, 2021, 12:49pm UTC](https://meta.discourse.org/t/after-activating-https-discourse-doesn-t-work/206907/9 "2021-10-25T12:49:03Z")

</div>

I have simply meant, that I how found no error or anything like this in the log. (See Screenshot)  
The build-process SEEMS to be OK …

I have now requested the final domain. I will rebuild the app with it.

After removing all the lets encrypt specific seetings and using the original host name of the VM everything works. I do not know whats is wrong with these settings.

---

<div class="post-metadata">

### Author: ![ITAS-Isti](https://avatars.discourse-cdn.com/v4/letter/i/87869e/32.png) [@ITAS-Isti](https://meta.discourse.org/u/ITAS-Isti)
#### Post date: [October 27, 2021, 10:37pm UTC](https://meta.discourse.org/t/after-activating-https-discourse-doesn-t-work/206907/10 "2021-10-27T22:37:37Z")

</div>

Hi Simon,

I have rebuild it again and I have seen that the ceritificate is issue with the wrong name:

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

Is the app.yml possibly configured on a wrong way?

[app.txt](https://meta.discourse.org/uploads/short-url/gbKnh5l8bwuve72EWZliIRxKdkz.txt) (4,1 KB)

What do you mean?

I

---

<div class="post-metadata">

### Author: ![IAmGav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamgav/32/235598_2.png) [@IAmGav](https://meta.discourse.org/u/IAmGav)
#### Post date: [October 27, 2021, 10:46pm UTC](https://meta.discourse.org/t/after-activating-https-discourse-doesn-t-work/206907/11 "2021-10-27T22:46:29Z")

</div>

line 51

` DISCOURSE_HOSTNAME: deinbalkonnetz.de`

that is not your config file. where did you get it from ?

---

<div class="post-metadata">

### Author: ![ITAS-Isti](https://avatars.discourse-cdn.com/v4/letter/i/87869e/32.png) [@ITAS-Isti](https://meta.discourse.org/u/ITAS-Isti)
#### Post date: [October 27, 2021, 10:52pm UTC](https://meta.discourse.org/t/after-activating-https-discourse-doesn-t-work/206907/12 "2021-10-27T22:52:29Z")

</div>

???

It IS my config file … We have routed this domain to our VM and I am trying to set up Discourse on this server …

---

<div class="post-metadata">

### Author: ![IAmGav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamgav/32/235598_2.png) [@IAmGav](https://meta.discourse.org/u/IAmGav)
#### Post date: [October 27, 2021, 10:54pm UTC](https://meta.discourse.org/t/after-activating-https-discourse-doesn-t-work/206907/13 "2021-10-27T22:54:15Z")

</div>

then everywhere in the config where ` deinbalkonnetz.de` is, you need to change.

after that, then you need to rebuild the app

---

<div class="post-metadata">

### Author: ![ITAS-Isti](https://avatars.discourse-cdn.com/v4/letter/i/87869e/32.png) [@ITAS-Isti](https://meta.discourse.org/u/ITAS-Isti)
#### Post date: [October 28, 2021, 8:16am UTC](https://meta.discourse.org/t/after-activating-https-discourse-doesn-t-work/206907/15 "2021-10-28T08:16:42Z")

</div>

What do you mean with everywhere?  
The hostname is only used @Line 51 …

I do not know other config files but the app.yml …

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [October 28, 2021, 8:20am UTC](https://meta.discourse.org/t/after-activating-https-discourse-doesn-t-work/206907/16 "2021-10-28T08:20:29Z")

</div>

Perhaps this will help?

> [@Change the domain name or rename your Discourse](https://meta.discourse.org/t/change-the-domain-name-or-rename-my-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 …

---

<div class="post-metadata">

### Author: ![ITAS-Isti](https://avatars.discourse-cdn.com/v4/letter/i/87869e/32.png) [@ITAS-Isti](https://meta.discourse.org/u/ITAS-Isti)
#### Post date: [October 28, 2021, 9:00am UTC](https://meta.discourse.org/t/after-activating-https-discourse-doesn-t-work/206907/17 "2021-10-28T09:00:42Z")

</div>

Thank you Jammy,

these are importan points, no question.

The problem is, that my hostname is not used at all  
DISCOURSE\_HOSTNAME: ‘[deinbalkonnetz.de](http://deinbalkonnetz.de)’

 ![image](https://global.discourse-cdn.com/meta/original/3X/a/c/ac9aead40979aa2dae3f04f2d70394f358444fc1.jpeg)

I think instead of the variable-name the real hostname “[deinbalkonnetz.de](http://deinbalkonnetz.de)” schould be used at the certificate.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [October 28, 2021, 9:07am UTC](https://meta.discourse.org/t/after-activating-https-discourse-doesn-t-work/206907/18 "2021-10-28T09:07:00Z")

</div>

Can you add [http://deinbalkonnetz.de/](http://deinbalkonnetz.de/) as a second domain to the letsencrypt certificate as a possible workaround?

> [@Set up Let’s Encrypt with multiple domains / redirects](https://meta.discourse.org/t/setting-up-let-s-encrypt-with-multiple-domains/56685):
>
> 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…
