我有下一个配置,docker-compose.yml:
version: '3'
services:
reverse-proxy:
image: traefik
ports:
- "80:80"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /root/traefik/traefik.yml:/etc/traefik/traefik.yml
whoami:
# A container that exposes an API to show its IP address
image: traefik/whoami
labels:
- "traefik.http.routers.whoami.rule=Host(`whoami.docker.server`)"和traefik.yml:
api: {}动态配置:
http:
routers:
api:
rule: Host(`traefik.example.com`)
service: api@internal
middlewares:
- auth
middlewares:
auth:
basicAuth:
users:
- "test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/"
- "test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"当我试图通过域访问仪表板时,我得到了"404未找到“:
curl -H Host:traefik.example.com http://127.0.0.1配置有什么问题?
发布于 2022-06-02 07:26:41
对于curl,您使用的是traefik.example.com作为主机,而您的whoami标签规则只匹配whoami.docker.server。试着改变其中的任何一个。
https://stackoverflow.com/questions/72350998
复制相似问题