Unable To Connect/Connection Refused due to https certificates

I met exectly the same prompt from chrome.

For my case there were several configuration that was wrongly setted, some were Discourse settings, some were hosting server configuration. I post my checklist here for you as a reference:

  1. Check /var/discourse/containers/app.yml

(Follow this post: Advanced Setup Only: Allowing SSL / HTTPS for your Discourse Docker setup )

Make sure you either allows https/http (open the 443 port, uncomment the ssl related template config, and the Let’sEncrypted related configs), or only http request (ban the 443 port, comment out the ssl related template config and Let’sEncrypted related configs).

If any changes were made to app.yml, run ./launcher rebuild app to activate the updated configs.

  1. Run ./laucher logs app.

If you failed frequently to rebuild a functional discourse server, like I did, you may at the same time had requested too much Let’s Encrypt credentials and exeeded their limit.

Then run ./laucher logs app will print a json. with a 429 error included.

  1. Check your Security group settings for your ECS server instance

In my case, Security group is simply a bundle of perssioned ports (for example, 80 HTTP 443 HTTPs), whichs allow you to control your server’s transportation with the outter space.

Make sure to allow the ports that are necessary for hosting discourse.

  1. Check firewall settings

In my case, step 3 didn’t open the required ports for me. Something wrong happened with my firewall settings.

it’s weird that I never set the firewall for my server, but those ports were indeed opened after configured with
apt install firewall-cmd
firewall-cmd --permanent --add-port=20-21/tcp (… and the other ports)
firewall-cmd --reload

You check the status of opened ports for your domain with some online services.

2 Likes