【问题标题】:Override backend url from CLI for proxy to Host machine从 CLI 覆盖后端 url 以代理到主机
【发布时间】:2018-11-03 07:42:29
【问题描述】:

是否可以从 CLI 覆盖文件提供程序的后端 URL?

例如:

docker rm -f traefik-cockpit; docker run -d  -p 443:443 \
-v /var/run/docker.sock:/var/run/docker.sock \
--label 'traefik.enable=true' \
--label 'traefik.file.backend.url=127.0.0.1' \
--label 'traefik.docker.network=host' \
--label 'traefik.frontend.rule=Host:cockpit.myexample.com' \
--label 'traefik.port=9090' \
--label 'traefik.protocol=http' \
--name traefik-cockpit \
traefik:v1.6.6-alpine \
--file \
--defaultentrypoints="https" \
--entryPoints='Name:https Address::443 TLS' \
--docker.endpoint=unix:///var/run/docker.sock \
--docker.exposedbydefault=false \
--docker.watch=true 

有很多应用程序直接在主机上运行,​​这将从 CLI 启用文件提供程序的自动配置

可能的解决方案:

--label 'traefik.file.backend.url=127.0.0.1' \
--label 'traefik.docker.network=host' \

--label 'traefik.file.backend.url=192.168.0.5' \

谢谢

【问题讨论】:

    标签: traefik


    【解决方案1】:

    这是不可能的:

    • 标签用于静态配置
    • 后端和前端处于动态配置中

    https://docs.traefik.io/basics/#configuration

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-10
      • 2016-09-01
      • 2023-03-27
      • 1970-01-01
      • 2018-05-08
      • 2014-08-21
      相关资源
      最近更新 更多