【问题标题】:Traefik - Can't connect via httpsTraefik - 无法通过 https 连接
【发布时间】:2018-01-13 21:38:43
【问题描述】:

我正在尝试在 Raspberry Pi Docker Swarm 上运行 Traefik(特别遵循 OpenFaaS 项目中的本指南 https://github.com/openfaas/faas/blob/master/guide/traefik_integration.md),但在实际尝试通过 https 连接时遇到了一些麻烦。

具体有两个问题:

1) 当我连接到http://192.168.1.20/ui 时,我会收到用户名/密码提示。但是,不接受由 htpasswd 生成并在以下 docker-compose.yml 中使用的详细信息(未散列的密码)。

2) 访问 https 版本 (http://192.168.1.20/ui) 根本无法连接。如果我尝试使用我在--acme.domains 中设置的域进行连接,这也是一样的

当我探索/etc/ 时,我可以看到不存在/etc/traefik/ 目录,但大概应该创建,所以这也许是我问题的根源?

我的docker-compose.yml 的相关部分看起来像

traefik:
    image: traefik:v1.3
    command: -c --docker=true
        --docker.swarmmode=true
        --docker.domain=traefik
        --docker.watch=true
        --web=true
        --debug=true
        --defaultEntryPoints=https,http
        --acme=true
        --acme.domains='<my domain>'
        --acme.email=myemail@gmail.com
        --acme.ondemand=true
        --acme.onhostrule=true
        --acme.storage=/etc/traefik/acme/acme.json
        --entryPoints=Name:https Address::443 TLS
        --entryPoints=Name:http Address::80 Redirect.EntryPoint:https
    ports:
        - 80:80
        - 8080:8080
        - 443:443
    volumes:
        - "/var/run/docker.sock:/var/run/docker.sock"
        - "acme:/etc/traefik/acme"
    networks:
        - functions
    deploy:
        labels:
            - traefik.port=8080
            - traefik.frontend.rule=PathPrefix:/ui,/system,/function
            - traefik.frontend.auth.basic=user:password  <-- relevant credentials from htpasswd here
        restart_policy:
            condition: on-failure
            delay: 5s
            max_attempts: 20
            window: 380s
        placement:
            constraints: [node.role == manager]

volumes:
  acme:

非常感谢任何帮助。

【问题讨论】:

    标签: https traefik


    【解决方案1】:
    猜你喜欢
    • 2013-03-05
    • 2019-11-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-19
    • 2021-11-16
    相关资源
    最近更新 更多