如何在traefik中添加通配符路由?

时间:2020-07-22 18:23:57

标签: docker-compose traefik

我有以下traefik.toml:

logLevel = "ERROR"

defaultEntryPoints = ["https","http"]

[entryPoints]
  [entryPoints.http]
  address = ":80"
    [entryPoints.http.redirect]
    entryPoint = "https"
  [entryPoints.https]
  address = ":443"
  [entryPoints.https.tls]

[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "admin.example.com"
watch = true
exposedByDefault = false

[acme]
--snip--

然后我们有一个docker-compose.yml

labels:
  - "traefik.docker.network=elastic"
  - "traefik.frontend.rule=Host:es.admin.example.com"
  - "traefik.enable=true"
  - "traefik.port=9200"
  - "traefik.frontend.entryPoints=http,https"
  - "traefik.default.protocol=http"
  - "traefik.backend=elastic_elasticsearch"

我想做nginx variables (cname) in proxy_pass的等效项而不破坏elasticsearch,即我想代理将Preview- \ d + .admin.example.com传递给Preview- \ d + .netlify.app。

0 个答案:

没有答案