discourse/docker에서 nginx 설정을 직접 업데이트하는 방법은 무엇인가요?

이 오래된 조언에서 설정을 편집하는 유사한 기법이 도움이 될 수 있습니다:

(이 위키 게시물의 이전 버전에서 가져옴: Set up Let’s Encrypt with multiple domains / redirects)

"실제로는 꽤 간단합니다. app.yml의 hooks 섹션에 다음과 같은 내용을 추가하세요:

2단계 - discourse.conf

1단계 외에도, DISCOURSE_HOSTNAME이 아닌 다른 도메인에 대해 nginx가 http를 https로 올바르게 리디렉션하도록 변경이 필요합니다.

    - replace:
        filename: "/etc/nginx/conf.d/discourse.conf"
        from: /return 301 https.+/
        to: |
          return 301 https://$host$request_uri;

또한, 이제 다른 도메인들도 있으므로 DISCOURSE_HOSTNAME만 강제하는 web.ssl.template.yml에서 추가되는 rewrite를 제거해야 합니다.

    - replace:
        filename: "/etc/nginx/conf.d/discourse.conf"
        from: /gzip on;[^\}]+\}/m
        to: |
          gzip on;
          add_header Strict-Transport-Security 'max-age=31536000'; # 1년 동안 인증서를 기억하고 이 도메인에 대해 자동으로 HTTPS로 연결