- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在 docker 中使用 traefik v2.2 设置测试环境。我设置了一个名为 traefik 的 docker 网络,带有一个测试 web 容器。如果我导航到 https://test.com,我可以看到我的仪表板,但是我看不到我的当我导航到规则设置的路径时的容器(即 https://test.com/myapp )
在仪表板中,状态看起来一切正常,显示了 myapp 容器的内部 ip,路由器和 https 入口点都正常。
如果我去https://test.com/myapp它给出了一个自定义的 404 页面“错误代码解释:404 = 没有匹配给定的 URI。”如果我去https://test.com/somenonexistantpath它给了我一个常规的 404 not found 消息
我试过更改主机规则。我将 traefik.docker.network=traefik 添加到容器标签,以防它们与 traefik 容器不在同一网络上,并验证我可以到达 http://myapp:80从 traefik 容器内部。根据 traefik v2 文档,主机规则看起来是正确的,所以我想知道我是否遗漏了什么。
我确实测试了将 test.com 主机规则移动到 myapp 并且能够到达测试站点,所以我好像缺少一些路径
下面是我的 docker-compose 文件,配置文件 dynamic-traefik.yaml 只有 tls 信息
version: '3.3'
networks:
traefik:
external: true
services:
traefik:
image: traefik:v2.2 #latest pull as of Feb 25, 2020
container_name: traefik
restart: always
networks:
- traefik
ports:
- "443:443"
volumes:
- ${PWD}/traefik:/traefik # Traefik static config
- /var/run/docker.sock:/var/run/docker.sock:ro # SSL Development certificates
command:
- "--log.level=DEBUG"
#- "--accesslog=true"
- "--api=true"
- "--api.dashboard=true"
- "--api.debug=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=traefik"
- "--providers.docker.endpoint=unix:///var/run/docker.sock"
- "--providers.docker.watch=true"
- "--entrypoints.https.address=:443"
# apparently you still neeed an extra file to specify TLS
- "--providers.file.filename=/traefik/dynamic-traefik.yaml"
labels:
- "traefik.enable=true"
# Traefik Dashboard
- "traefik.http.routers.traefik.rule=Host(`test.com`)" #works but only gives you dashboard
- "traefik.http.routers.traefik.service=api@internal"
- "traefik.http.routers.traefik.entrypoints=https"
- "traefik.http.routers.traefik.tls=true"
- "traefik.docker.network=traefik"
myapp:
image: yeasy/simple-web:latest
container_name: myapp
restart: always
networks:
- traefik
labels:
- "traefik.enable=true"
- "traefik.http.routers.myapp.entrypoints=https"
- "traefik.http.routers.myapp.rule=Host(`test.com`) && PathPrefix(`/myapp`)"
- "traefik.http.routers.myapp.service=myapp"
- "traefik.http.routers.myapp.tls=true"
- "traefik.http.services.myapp.loadbalancer.server.port=80" #this is needed to point to the correct port on the service container
- "treafik.docker.network=traefik"
最佳答案
你需要指定priority并为 myapp 路由器提高它,以便它首先处理
关于docker - traefik 2.2 反向代理 https 不显示我的容器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60606789/
我正在尝试使用两个域和使用 Let's Encrypt 生成的证书来设置 traefik 的 dockerized 版本。 我已经修改了 traefik.toml 看起来像这样: [acme] e
traefik.frontend.rule=Host:example.com 将对 example.com 的请求重定向到该后端。那么traefik.domain有什么用呢? 最佳答案 默认前端规则为
traefik.frontend.rule=Host:example.com 将对 example.com 的请求重定向到该后端。那么traefik.domain有什么用呢? 最佳答案 默认前端规则为
我使用 docker compose(运行 swarm 模式)进行了以下设置: mydomain.com --> ContainerA:8080 但我想要的是通过标签,为同一个容器指定以下内容: my
我正在尝试使用 Traefik 在我的 Docker Swarm 模式集群中部署代理多个应用程序。 我已经得到它以便它代理一个命名的主机,但我希望它代理一个命名的主机和路径,但我无法计算出我需要使用的
我绝对爱上了 Traefik。然而,作为初学者,我想念 Nginx 风格 nginx -t来验证配置文件。 我在 docker 容器中运行 traefik,每当我更新我的配置文件(*.toml 文件)
我决定将 traefik 的版本从 1.7.x 升级到 2.2.1。 所以我遵循了上述解决方案的指导方针(https://gist.github.com/fatihyildizhan/8f124039
我们使用 traefik 来反向代理我们的微服务环境,在 Kubernetes 的 staging 和 prod 上运行,并在本地使用 docker-compose。我们正在尝试将请求代理到特定微服务
如何为日志文件启用日志轮换,例如访问.log。 这是内置的吗? 文档只说“这允许日志由外部程序旋转和处理,例如 logrotate” 最佳答案 如果您正在运行 Traefik 在 docker 容器然
我需要像这样重写我的应用程序的 URL:https://router.vuejs.org/guide/essentials/history-mode.html#example-server-confi
我需要将 SSL 连接直接发送到后端,而不是在我的 Traefik 上解密。后端需要接收https请求。 我尝试了 traefik.frontend.passTLSCert=true 选项,但是当我访
使用 docker,我尝试使用 HTTPS 端口 443 设置 traefik 后端,因此 traefik 容器和应用程序容器(apache 2.4)之间的通信将被加密。 我收到了 Internal
我有一个容器('矩阵'),基于 https://github.com/silvio/docker-matrix (虽然这可能并不重要)。 它在端口 8448 和 3478(不是 80 或 443)上运
我是 Docker 和 Traefik 的新手,所以我决定和他们一起玩一下。我试着按照这个 digital ocean 教程:https://www.digitalocean.com/communit
我有一个“服务器”设置,在容器中运行多个服务,其中 traefik 工作得很好。我想为在单独计算机上运行的服务添加虚拟主机,以便我可以访问 hassio.domain.com 并转发到该服务器。有一次
我已经将 Traefik 设置为在 Docker Swarm 模式下工作。我已使用以下命令将 Portainer 部署到集群中: docker service create
我正在从 Nginx 迁移到 Traefik 作为 Docker Swarm 的反向代理。 目前,每个带有 Bearer Token 的请求都会被发送到身份验证服务(在 Swarm 中运行的微服务),
使用 docker 容器中的 Traefix 1.2.3 版,我设置了以下文件。 traefik: image: traefik command: --web --docker --docke
我正在考虑为我的网络项目 (Kestrel/.Net Core) 将 Apache 替换为 Traefik。阅读文档后,关于 Traefik,我还有一些不清楚的地方: 1/Traefik 是否自动处理
我提前为我对 Traefik 的新手理解道歉,但有没有办法重写“非 www”域 带有基于请求的变量 ? 我已经在谷歌上搜索了一个多小时,找不到答案。 这是我如何在 Apache 中执行此操作的示例。你
我是一名优秀的程序员,十分优秀!