docker - Traefik v2.5 未重定向到搬运工容器。404 未找到
问题描述
我正在尝试让 traefik 与 portainer 一起工作,但到目前为止还没有。我的目标是输入http://localhost/portainer
并让 traefik 重定向到 portainer 门户。
到目前为止,我的 docker-compose 看起来像这样:
services:
reverse-proxy:
image: traefik
container_name: "traefik"
networks:
- traefik_net
ports:
- "80:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "./traefik.yml:/traefik.yml:ro"
portainer:
image: "portainer/portainer-ce"
container_name: "portainer"
networks:
- traefik_net
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- portainer_data:/data"
labels:
- "traefik.enable=true"
- "traefik.http.routers.portainer.entrypoints=web"
- "traefik.http.routers.portainer.rule=Host(`localhost`) && PathPrefix(`/portainer`)"
- "traefik.http.services.portainer.loadbalancer.server.port=9000"
networks:
traefik_net: {}
volumes:
portainer_data:
我的 traefik.yml 文件是:
log:
level: INFO
api:
insecure: true
dashboard: true
entryPoints:
web:
address: ":80"
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
exposedByDefault: false
我真的不知道发生了什么事。当我尝试连接时,http://localhost/portainer
我得到404 not found
.
仪表板工作正常。当我检查 portainer 服务是否具有 portainer 容器的 docker ip 以及端口 9000 时,所以我认为问题在于 traefik 接收并将 url 重定向到 portainer 容器。
欢迎任何帮助,谢谢。
解决方案
Portainer 还不支持子路径,你可以在这里提出请求https://github.com/porttainer/portainer/issues?q=is%3Aissue+is%3Aopen
推荐阅读
- javascript - 意外的字符'?表示
- android - 如何在android中解析本地json
- sql - SQL 导入 10000+ .csv 文件
- emacs - 使用 GUI 与终端 emacs 的 paredit 键绑定
- c - 有重复答案且不正确的正态分布计算
- javascript - 无法读取未定义猫鼬 Nodejs 的属性“id”
- mongodb - 如何在 mongoose .save().then() 之外返回一个对象?
- android - 如何用一个 Activity 创建多个 View
- python - 在不关闭或停止程序的情况下保存对 xlsxwriter 工作簿的更改
- python - 按小时间隔查找平均人数,Panda/Numpy