SSL 인증서 추가

SSL 인증서를 구매하고 다음 지침을 따랐습니다:

Allow SSL / HTTPS for your Discourse Docker setup - Documentation / Self-Hosting - Discourse Meta

해당 지침에는 ssl.key와 ssl.crt 파일을 /var/discourse/shared/standalone/ssl/ 경로에 배치하고 app.yml에 추가 템플릿을 포함하는 단계를 포함하고 있었습니다.

SSL을 활성화하기 전에는 사이트가 완벽하게 정상 작동했지만, SSL을 활성화하자 사이트가 다운되어 “Unable to connect” 또는 “Server not found” 오류가 발생하고 있습니다.

2024/06/13 09:25:08 [emerg] 5152#5152: cannot load certificate "/shared/ssl/communities-dev.np.norton.com.cer": PEM_read_bio_X509_AUX() failed (SSL: error:0909006C:PEM routines:get_name:no>
2024/06/13 09:25:09 [warn] 5182#5182: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/discourse.conf:60

제 app.yml 파일은 다음과 같습니다.

##
## After making changes to this file, you MUST rebuild
## /var/discourse/launcher rebuild app
##
## BE *VERY* CAREFUL WHEN EDITING!
## YAML FILES ARE SUPER SUPER SENSITIVE TO MISTAKES IN WHITESPACE OR ALIGNMENT!
## visit http://www.yamllint.com/ to validate this file as needed

templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  ## Uncomment the next line to enable the IPv6 listener
  #- "templates/web.ipv6.template.yml"
  - "templates/web.ratelimited.template.yml"
  ## Uncomment these two lines if you wish to add Lets Encrypt (https)
  - "templates/web.ssl.template.yml"
  - "templates/web.letsencrypt.ssl.template.yml"

## which TCP/IP ports should this container expose?
## If you want Discourse to share a port with another webserver like Apache or nginx,
## see https://meta.discourse.org/t/17247 for details
expose:
  - "80:80"   # http
  - "2222:22"
  - "443:443" # https
  
  
   ## The http or https CDN address for this Discourse instance (configured to pull)
  ## see https://meta.discourse.org/t/14857 for details
  #DISCOURSE_CDN_URL: https://discourse-cdn.example.com

  ## The maxmind geolocation IP account ID and license key for IP address lookups
  ## see https://meta.discourse.org/t/-/173941 for details
  #DISCOURSE_MAXMIND_ACCOUNT_ID: 123456
  #DISCOURSE_MAXMIND_LICENSE_KEY: 1234567890123456
  DISCOURSE_USE_SSL: true
  DISCOURSE_SSL_CERTIFICATE_PATH: /var/discourse/shared/standalone/ssl/domain-name.cer
  DISCOURSE_SSL_KEY_PATH: /var/discourse/shared/standalone/ssl/domain-name.key
  DISCOURSE_SSL_CA_PATH: /var/discourse/shared/standalone/ssl/intermediate.cer

## The Docker container is stateless; all data is stored in /shared
volumes:
  - volume:
      host: /var/discourse/shared/standalone
      guest: /shared
  - volume:
      host: /var/discourse/shared/standalone/log/var-log
      guest: /var/log

도와주실 수 있는 분 계신가요?

Let’s Encrypt를 사용하지 않는다면 이 템플릿을 활성화하지 않아야 합니다.
인증서 경로가 변경됩니다.

기본 Let’s Encrypt 인증서를 사용하지 않으려는 특별한 이유가 있나요? 이렇게 하는 것이 훨씬 더 쉽습니다.

팀에서 Digicert의 SSL 인증서를 받아서 해당 인증서, 개인 키, 중간 인증서를 /var/discourse/shared/standalone/ssl 경로에 추가했습니다. 또한 게시물에 첨부한 대로 app.yml 파일도 일부 수정했습니다.

여기서 제가 놓치고 있는 부분이 많은 것 같은데, 어디서 잘못되고 있는지 명확히 알려주시면 감사하겠습니다. 어떤 해결책도 다 열어두고 있습니다.

왜 그렇게 하셨나요?

방화벽 뒤에 계신가요? 그렇지 않다면 표준 설치만으로도 무료 인증서를 자동으로 발급받아 바로 사용할 수 있습니다.