# 与 Traefik 2.0 的讨论

**URL:** <https://meta.discourse.org/t/discourse-with-traefik-2-0/130357>\
**Category:** Self-hosting\
**Created:** [2019年十月6日 18:57 UTC](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357 "2019-10-06T18:57:04Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![SvenC56](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/svenc56/32/132235_2.png) [@SvenC56](https://meta.discourse.org/u/SvenC56)\
**Post date:** [2019年十月6日 18:57 UTC](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357/1 "2019-10-06T18:57:04Z")

</div>

大家好，

我正在迁移到新服务器，并希望使用 Traefik 2.0 作为反向代理。目前我在新的配置上遇到了困难。我在 `app.yml` 文件底部添加了一个部分。（来源：[https://meta.discourse.org/t/discourse-behind-traefik/84874）](https://meta.discourse.org/t/discourse-behind-traefik/84874%EF%BC%89)

```plaintext
...

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

...

docker_args:
  - "--network=web"
  - "--expose=8060"
  - "-l traefik.enable=true"
  - "-l traefik.http.routers.forum.rule=Host(`forum.example.com`)"
  - "-l traefik.http.routers.forum.entrypoints=websecure"
  - "-l traefik.http.routers.forum.tls=true"
  - "-l traefik.http.routers.forum.tls.certresolver=mytlschallenge"
  - "-l traefik.http.services.forum.loadbalancer.server.port=8060"
  - "-l traefik.docker.network=web"

```

这似乎不起作用。当我访问该路由时，会收到 `Bad Gateway` 错误。但如果直接访问 `ip_adress:8060`，Discourse 可以正常打开。

有人有使用 Traefik 2.0 的经验吗？

谢谢！

---

_[View the full topic](https://meta.discourse.org/t/discourse-with-traefik-2-0/130357)._
