After activating HTTPS Discourse doesn´t work


after activating Lets Enrypt Templates and rebuilding Discourse nothing works:

NGINX gives a cryptical error:

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

These templates are active:

These are the settings, the app has been rebuilt with

What can be the reason of this issues?
I think the cert should be issued for the hostname:

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


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

1 Like

No, I have checked it in the correct directory:

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

cd /var/discourse
./launcher enter app

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

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:

  return 301$request_uri;
1 Like

Thank you.
I have found as follows:

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

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?

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.

Yeah, this is how I have rebuilt the app …

After rebuild seems everythin to work:

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.

So you solved your problem by rebuilding?

You should mark that post as the solution.

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.

Hi Simon,

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


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

app.txt (4,1 KB)

What do you mean?


line 51


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


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

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

after that, then you need to rebuild the app

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

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

Perhaps this will help?

1 Like

Thank you Jammy,

these are importan points, no question.

The problem is, that my hostname is not used at all

I think instead of the variable-name the real hostname “” schould be used at the certificate.

Can you add as a second domain to the letsencrypt certificate as a possible workaround?