Unable To Connect/Connection Refused due to https certificates

We successfully installed Discourse through DigitalOcean using the following guide:

discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub

Our DNS is fully propagated, and we also installed our SSL CERTS per the following guide:

When browsing to our Discourse installation via IP or domain name, we get the following message:

This site can’t be reached

XX.XX.XX.XX refused to connect.
Try:
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED

What could be the problem?

Almost certainly a SSL problem. Try rebuilding with plain HTTP first to make sure everything is working before adding on the complexity of HTTPS.

Using let’s encrypt is an easy way to get ssl.

… thanks for your help.

I am running into this same issue, To rebuild with plain HTTP, does that require just commenting out the SSL template line in app.yml?

Yes, but browsers that have visited your site will refuse to connect. You really should use https.

For anyone that face it in the future, make sure to not exceed the rate limit of LetsEncrypt:

You can see if it was exceeded in the logs:

./launcher logs app

크롬에서 정확히 동일한 프롬프트를 확인했습니다.

제 경우엔 여러 설정이 잘못되어 있었는데, 일부는 Discourse 설정이고 일부는 호스팅 서버 설정이었습니다. 참고용으로 제 체크리스트를 여기에 공유합니다:

  1. /var/discourse/containers/app.yml 파일 확인

(이 게시글을 참고하세요: Allow SSL / HTTPS for your Discourse Docker setup )

https/http를 모두 허용하는지(443 포트 열기, ssl 관련 템플릿 설정 주석 해제, Let’s Encrypt 관련 설정 활성화) 아니면 http 요청만 허용하는지(443 포트 차단, ssl 관련 템플릿 설정 및 Let’s Encrypt 관련 설정 주석 처리) 확인하세요.

app.yml 파일에 변경 사항이 있다면 ./launcher rebuild app 명령을 실행하여 업데이트된 설정을 적용하세요.

  1. ./laucher logs app 실행

저처럼 기능하는 Discourse 서버를 재빌드하는 데 자주 실패했다면, Let’s Encrypt 자격 증명을 너무 많이 요청하여 한도를 초과했을 수도 있습니다.

이 경우 ./laucher logs app을 실행하면 429 에러가 포함된 json.이 출력됩니다.

  1. ECS 서버 인스턴스의 Security group(보안 그룹) 설정 확인

제 경우, Security group은 단순히 허용된 포트들의 묶음(예: 80 HTTP, 443 HTTPS)으로, 서버가 외부와 통신하는 것을 제어할 수 있게 해줍니다.

Discourse 호스팅에 필요한 포트가 허용되어 있는지 확인하세요.

  1. 방화벽 설정 확인

제 경우, 3단계에서 필요한 포트가 열리지 않았습니다. 방화벽 설정에 문제가 있었던 것입니다.

이상하게도 저는 서버 방화벽을 설정한 적이 없는데, 아래 명령어로 설정한 후에야 해당 포트가 실제로 열렸습니다.
apt install firewall-cmd
firewall-cmd --permanent --add-port=20-21/tcp (… 그리고 다른 포트들)
firewall-cmd --reload

온라인 서비스를 사용하여 도메인의 열려 있는 포트 상태를 확인해 보세요.

저도 같은 문제를 겪었습니다 - 인증서 사용 한도를 초과한 것이었죠.

1단계(앱의 app.yml 파일에서 SSL 템플릿 2개를 주석 처리)를 따르고, 재빌드 후 다른 브라우저로 사이트를 열어서 해결했습니다.

한 주가 지나면 SSL을 다시 활성화할 수 있을 것 같습니다.

일주일이 지난 후 연결할 수 있었나요?