gpt4 book ai didi

docker - 找不到Traefik和Nginx 404页面

转载 作者:行者123 更新时间:2023-12-02 18:27:40 26 4
gpt4 key购买 nike

我想将Traefik与Nginx一起使用时收到404 http错误。

如果仅部署nginx,则可以使用,但是当添加traefik配置时,会收到404。

Traefik配置

    defaultEntryPoints = ["https", "http"]
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[acme]
email = "info@xxxxxx.com"
storage = "acme.json"
acmeLogging = true
entryPoint = "https"
OnHostRule = true
ondemand = false
[acme.httpChallenge]
entryPoint = "http"
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "docker.localhost"
watch = true
swarmmode = true
exposedbydefault = false

Traefik docker -撰写
    image: traefik:v1.7.9
command: --web --docker --docker.domain=docker.localhost --logLevel=DEBUG
ports:
- "80:80"
- "443:443"
- "8080:8080"
networks:
- traefik
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./conf.d/traefik.toml:/traefik.toml
- ./conf.d/acme.json:/acme.json:rw
- /var/log/traefik:/var/log/traefik

Nginx docker -组成
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./html:/usr/share/nginx/html
- ./conf.d/nginx.conf:/etc/nginx/nginx.conf
- /var/log/nginx:/var/log/nginx
networks:
- traefik
labels:
- "traefik.enable=true"
- "traefik.baclend=nginx"
- "traefik.frontend.passHostHeader=true"
- "traefik.frontend.entryPoints=[http,https]"
- "traefik.frontend.headers.SSLRedirect=true"
- "traefik.frontend.rule=Host:domaixxxxxx.com"
- "traefik.port=443"

我愿意接受任何建议
谢谢!

最佳答案

您在nginx的docker-compose配置中有错字,baclend应该是backend

关于docker - 找不到Traefik和Nginx 404页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57736993/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com