# Traefik Proxyでアクセスできない

**URL:** <https://meta.discourse.org/t/inaccessible-behind-traefik-proxy/295508>\
**Category:** Self-hosting\
**Created:** [2024 年 2 月 15 日午後 5:00 UTC](https://meta.discourse.org/t/inaccessible-behind-traefik-proxy/295508 "2024-02-15T17:00:54Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![tgrosinger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgrosinger/32/363506_2.png) [@tgrosinger](https://meta.discourse.org/u/tgrosinger)\
**Post date:** [2024 年 2 月 15 日午後 5:00 UTC](https://meta.discourse.org/t/inaccessible-behind-traefik-proxy/295508/1 "2024-02-15T17:00:54Z")

</div>

Traefik プロキシで Discourse を実行することについての多くの投稿を読みましたが、残念ながらまだ何かを見落としているようです。

ホストからコンテナの内部 IP を curl すると、Discourse セットアップウィザードの HTML が返され、Traefik はサービスが利用可能であることを報告します。

 ![image](https://global.discourse-cdn.com/meta/original/4X/b/4/f/b4fe529a2de55865920429f5a4191d7c96fb3bf4.png)

しかし、Traefik を経由するドメインに接続しようとすると、期待どおりの HTTPS 証明書が表示されますが、数秒後に 504 エラーが発生します。

以下は Discourse の設定です。

```yaml
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

## 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 の間でどこかで失われているようです。

---

_[View the full topic](https://meta.discourse.org/t/inaccessible-behind-traefik-proxy/295508)._
