Containerized Transmission behind Traefik2 and proxied by Cloudflare

Hi to all,

I'm trying to configure my Transmission app in a docker behind Traefik2 using Cloudflare as my DNS and proxy provider. I've found several configs in this and other forums. However non of them did not work for me. Below I attach my latest config:

version: "3.4"
services:
  transmission:
    image: linuxserver/transmission:latest
    container_name: transmission
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TRANSMISSION_WEB_HOME=/combustion-release/ #optional
      - USER=${USER} #optional
      - PASS=${PASSWORD} #optional
    volumes:
      - /home/docker/transmission:/config
      - /srv/dev-disk-by-label-P2P:/downloads
      - /srv/dev-disk-by-label-P2P/watch:/watch
    ports:
      - ${WEB-UI}:9091
      - ${TRANSMISSION_PORT}:${TRANSMISSION_PORT}
      - ${TRANSMISSION_PORT}:${TRANSMISSION_PORT}/udp
    restart: unless-stopped
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.transmission.entrypoints=https"
      - "traefik.http.services.transmission.loadBalancer.server.port=${WEB-UI}"
      - "traefik.http.routers.transmission.rule=Host(`utt.example.com`) && (PathPrefix(`/transmission`))"
      - "traefik.http.routers.transmission.tls=true"
      - "traefik.http.routers.transmission.tls.certresolver=cloudflare"
      - "traefik.http.routers.transmission.tls.domains[0].main=utt.example.com"
      - "traefik.http.routers.transmission.tls.domains[0].sans=`*.example.com`"
      - "com.centurylinklabs.watchtower.enable=true"

Obviously, instead of "example.com", you should refer to an actual FQDN. Dockers run ok, without any error or warning. However, there is no access to the service. Nextcloud and Traefik itself are perfectly accessible through their web addresses with an active Proxy by Cloudflare.

Does anyone has experience in this? As far as I understand the main problem here is to make a correct redirection of http traffic generated by Transmisssion app into https.

After many hours of googling and endless attempts of configuring my transmission docker file, finally I could successfully access its web UI using cloudflare as a DNS provider and its proxy service! For anyone who has a similar problem might find my solution helpful.

version: "2.1"
services:
  transmission:
    image: linuxserver/transmission:latest
    container_name: transmission
    networks:
      - proxy
    environment:
      - PUID=$PUID
      - PGID=$PGID
      - TZ=YOUR TIME ZONE
      - TRANSMISSION_WEB_HOME=/combustion-release/ #optional
      - USER=username #optional
      - PASS=password #optional
    volumes:
      - /config location on disk:/config
      - /downloads location on disk:/downloads
    ports:
      - TCP port for communication with other peers: corresponding port inside the container
      - UDP port for communication with other peers: corresponding port inside the container/udp
    restart: unless-stopped
    depends_on:
       - traefik
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=proxy"
      - "traefik.passHostHeader=true"
     ## HTTP Routers
      - "traefik.http.routers.transmission.entrypoints=https"
      - "traefik.http.routers.transmission.rule=Host(`transmission.YOURDOMAIN.NAME`)"
      - "traefik.http.routers.transmission.tls.certresolver=cloudflare"
      - "traefik.http.routers.transmission.tls=true"
      ## Middlewares
      - "traefik.http.routers.transmission.middlewares=user-auth@file"
      ## HTTP Services
      - "traefik.http.routers.transmission.service=transmission-svc"
      - "traefik.http.services.transmission-svc.loadbalancer.server.port=9091"
      - "traefik.http.services.transmission-svc.loadbalancer.server.scheme=http"
networks:
  proxy:
    external: true

There were two critical points where I made mistakes.

  1. First of all the loadbalancer MUST be at a standard port 9091 (unless you manually did not change inside the container). No need to expose this port at all.
  2. Another critical flag is "passHostHeader" which must be turned on, otherwise your transmission docker will refuse connection from the internet.
  3. "user-auth@file" middleware contains basic authentication information with USER and PASS taken from the "environment" field. I did not check whether these values can be different.

Cloudflare proxy service works like a charm with the configuration above allowing HTTPS connection! I'm closing this thread!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.