Traefik可以正常工作,但是挂在容器服务的登录名上

时间:2019-03-09 17:57:03

标签: docker traefik

我需要帮助调试一个奇怪的问题。

我正在尝试让Flood与Traefik一起运行,但是无法正常工作。

Flood容器会加载登录页面,但在登录时会挂起。这意味着traefik可以工作,但会导致其暂停。

直接通过docker host:port可以正常工作。

dockerhost.subdomain.TLD:3000有效,而flood.subdomain.TLD无效。

首先,我认为这可能是通过VPN容器路由泛洪的原因,但我已将其范围缩小到泛洪和Traefik之间。 I have registered an issue at Floods github with a video showing the behaviour

关于如何解决或进一步调试的任何意见?

谢谢!

traefik.toml

logLevel = "INFO"

[traefikLog]
  filePath = "/log/traefik.log"

defaultEntryPoints = ["http","https"]

[web]
  #Run Traefik info page at 8080.
  address = ":8080"

[entryPoints]
  [entryPoints.http]
  #redirect ALL http traffic to https 443
  address = ":80"
    [entryPoints.http.redirect]
    entryPoint = "https"
  [entryPoints.https]
  address = ":443"
  [entryPoints.https.tls]

[retry]

#Watch Docker, when new containers are created with label create mapping.
[docker]
  endpoint = "unix:///var/run/docker.sock"
  domain = "sub.domain.TLD"
  watch = true
  exposedbydefault = false


#Let's encrypt setup
[acme]
  email = "mail@domain.TLD"
  storage = "acme.json"
  entryPoint = "https"
  #When new host is created, request certificate.
  onHostRule = true
  acmeLogging = true
  #caServer = "https://acme-staging-v02.api.letsencrypt.org/directory"
[acme.dnsChallenge]
  provider = "cloudflare"
  delayBeforeCheck = 0
[[acme.domains]]
  main = "domain.TLD"
[[acme.domains]]
  main = "*.domain.TLD"
[[acme.domains]]
  main = "*.sub.domain.TLD"
docker-compose.yml中的

片段

  openvpn-client:
    container_name: openvpn-client
    image: dperson/openvpn-client
    restart: unless-stopped
    # cap_add, security_opt, and volume required for the image to function
    cap_add:
      - net_admin
    environment:
      TZ: '${TZ}'
      FIREWALL: ''
      ROUTE: '10.0.0.0/24'
    networks:
      - system_default
    ports:
      - 3000:3000 #flood
      - 51413:51413 #rtorrent
      - 6881:6881/udp #rtorrent
    read_only: true
    tmpfs:
      - /run
      - /tmp
    security_opt:
      - label:disable
    stdin_open: true
    tty: true
    volumes:
      - /dev/net:/dev/net:z
      - ./openvpn:/vpn

  flood:
    build: flood
    container_name: flood
    #ports:
    #  - 3000:3000
    network_mode: "service:openvpn-client"
    depends_on:
      - rtorrent
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
      - RTORRENT_SOCK=true
      - NODE_ENV=development
      - FLOOD_SECRET=flood
    volumes:
      - ./_shared/_download:/data/downloads
      - ./_shared/rtorrent-flood/socket:/data/socket
      - ./_shared/rtorrent-flood/flood:/data/flood
    restart: on-failure
    labels:
      - "traefik.port=3000"
      - "traefik.frontend.rule=Host:flood.subdomain.domain.TLD"
      - "traefik.docker.network=system_default"
      - "traefik.frontend.headers.SSLRedirect=true"
      - "traefik.frontend.headers.STSSeconds=315360000"
      - "traefik.frontend.headers.browserXSSFilter=true"
      - "traefik.frontend.headers.contentTypeNosniff=true"
      - "traefik.frontend.headers.forceSTSHeader=true"
      - "traefik.frontend.headers.STSIncludeSubdomains=true"
      - "traefik.frontend.headers.STSPreload=true"
      - "traefik.frontend.headers.frameDeny=true"

0 个答案:

没有答案