traefik https仅适用于重定向

时间:2019-07-31 22:30:31

标签: docker-compose traefik

我正在使用traefik,它的toml看起来像:

logLevel = "DEBUG"
defaultEntryPoints = ["http","https"]

[api]
address = ":8080"

[docker]
domain = "traefik"
swarmmode = true
watch = true

[entryPoints]
  [entryPoints.http]
  address = ":80"
  [entryPoints.https]
  address = ":443"
    [entryPoints.https.tls]

我正在使用docker swarm并部署带有以下标签的stack(compose)文件:

       "traefik.backend.loadbalancer.sticky": "False",
        "traefik.docker.network": "traefik_network",
        "traefik.enable": "true",
        "traefik.frontend.rule": "PathPrefixStrip:/",
        "traefik.port": "8443",
        "traefik.protocol": "https"

当我卷曲端点curl -ik https://traefik/index时,它会在traefik access.logs中显示其正确重定向了我的呼叫,但我不断收到500个内部服务器错误。如果我在http下设置了https redirect并从toml中删除了tls行,则当我curl -ik http://traefik/index

时,我的请求可以正常工作

1 个答案:

答案 0 :(得分:0)

我找到了这个问题的答案,添加了insecureSkipVerify=true解决了我的https请求问题:

logLevel = "DEBUG"
defaultEntryPoints = ["http","https"]
insecureSkipVerify=true

[api]
address = ":8080"

[docker]
domain = "traefik"
swarmmode = true
watch = true

[entryPoints]
  [entryPoints.http]
  address = ":80"
  [entryPoints.https]
  address = ":443"
    [entryPoints.https.tls]