Traefik 프록시 뒤에서 접근할 수 없음

Traefik 프록시 뒤에 Discourse를 실행하는 방법에 대한 게시글을 여러 개 읽어 보았지만, 불행히도 여전히 뭔가 빠진 것 같습니다.

호스트에서 컨테이너의 내부 IP를 curl로 호출하면 Discourse 설정 마법사의 HTML이 반환되는 것을 볼 수 있고, Traefik은 서비스가 사용 가능하다고 보고합니다:

그러나 Traefik을 통해가는 도메인에 연결하려고 하면 예상대로 https 인증서를 볼 수 있지만, 몇 초 후 504 오류가 발생합니다.

제 Discourse 설정은 다음과 같습니다:

templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  - "templates/web.ratelimited.template.yml"

expose:
  #- "80:80"   # http
  #- "443:443" # https

params:
  db_default_text_search_config: "pg_catalog.english"

env:
  LC_ALL: en_US.UTF-8
  LANG: en_US.UTF-8
  LANGUAGE: en_US.UTF-8

  DISCOURSE_HOSTNAME: 'redacted'
  DISCOURSE_DEVELOPER_EMAILS: 'redacted'

  DISCOURSE_SMTP_ADDRESS: smtp.postmarkapp.com
  DISCOURSE_SMTP_USER_NAME: redacted
  DISCOURSE_SMTP_PASSWORD: redacted
  DISCOURSE_NOTIFICATION_EMAIL: noreply@redacted

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

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git

docker_args:
  - "-l traefik.enable=true"
  - "-l traefik.http.routers.discourse.tls=true"
  - "-l traefik.http.routers.discourse.rule=Host(`redacted`)"
  - "-l traefik.http.routers.discourse.entrypoints=websecure"
  - "-l traefik.http.routers.discourse.tls.certresolver=ledns"
  - "-l traefik.http.services.discourse.loadbalancer.server.port=80"
  - "-l traefik.http.services.discourse.loadbalancer.server.scheme=http"

run:
  - exec: echo "Beginning of custom commands"
  - exec: echo "End of custom commands"

같은 Traefik 인스턴스에서 다른 호스트에 유사하게 구성된 여러 다른 서비스가 모두 정상적으로 작동하고 있습니다.

Discourse의 nginx 액세스 로그에서는 로컬 IP를 curl할 때 요청이 보이지만, 도메인을 curl할 때는 보이지 않습니다.

무엇이 빠져 있는지 제안해 주실 수 있을까요? Traefik과 nginx 사이에 어딘가에서 요청이 사라지는 것 같습니다.

문제를 찾았습니다. Traefik과 Discourse가 서로 다른 Docker 네트워크에 있었습니다. Docker 플래그를 추가하여 같은 네트워크에 배치하니 문제가 해결되었습니다.