Traefik前端不会返回后端响应

时间:2018-02-07 22:36:05

标签: traefik

我的前端不在后端上 例如:

$ curl rancher.foo.bar
404 page not found

$ curl http://172.17.0.3:8080
{"id":"v1", ...}

# traefik

$ curl http://foo.bar:8080/api/providers
{
  "docker": {
    "backends": {
      "backend-rancher": {
        "servers": {
          "server-rancher": {
            "url": "http://172.17.0.3:8080",
            "weight": 0
          }
        },
        "loadBalancer": {
          "method": "wrr"
        }
      }
    },
    "frontends": {
      "frontend-rancher-foo-bar-0": {
        "entryPoints": [
          "http"
        ],
        "backend": "backend-rancher",
        "routes": {
          "route-frontend-rancher-foo-bar-0": {
            "rule": "rancher.foo.bar"
          }
        },
        "passHostHeader": true,
        "priority": 0,
        "basicAuth": []
      }
    }
  }
}

怎么了?
为什么我得到404而不是200?

由于

1 个答案:

答案 0 :(得分:1)

您必须将前端的规则更改为Host:rancher.foo.bar