Docker-compose traefik PathPrefixStrip do not work correctly

Viewed 2804

I've a problem who drive me mad, please help me.

I want to access all my apps from one free no-ip subdomain, so I think traefik can do that for me, I want to access all my apps like that:

 mysubdomain.no-ip.com/emby
 mysubdomain.no-ip.com/pydio
 mysubdomain.no-ip.com/adminer...

Here is my docker compose:

version: "2"
services:
  db:
    image: linuxserver/mariadb
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: "test"
    labels:
      - "traefik.enable=false"
    volumes:
      - ./config/mariadb:/etc/mysql/
    ports:
      - '3306:3306'
  adminer:
    image: adminer
    restart: always
    labels:
      - "traefik.enable=true"
      - "traefik.backend=adminer"
      - "traefik.frontend.rule=PathPrefixStrip:/dbadmin"
      - "traefik.backend.port=8080"
    volumes:
      - ./config/adminer:/config
  emby:
    image: emby/embyserver:latest
    restart: always
    labels:
      - "traefik.enable=true"
      - "traefik.backend=emby"
      - "traefik.frontend.rule=PathPrefixStrip:/media"
      - "traefik.backend.port=8096"
    volumes:
      - ./config/emby:/config
  cloud:
    image: linuxserver/pydio:latest
    restart: always
    environment:
      PGID: "1000"
      PUID: "1000"
    labels:
      - "traefik.enable=true"
      - "traefik.backend=cloud"
      - "traefik.frontend.rule=PathPrefixStrip:/cloud"
      - "traefik.backend.port=443"
      - "traefik.protocol=https"
    volumes:
      - ./config/cloud:/config
      - ./data/test:/data
  organizr:
      image: lsiocommunity/organizr
      restart: always
      environment:
        PGID: "1000"
        PUID: "1000"
        TZ: "Europe/Paris"
      labels:
        - "traefik.enable=true"
        - "traefik.backend=organizr"
        - "traefik.frontend.rule=PathPrefixStrip:/"
        - "traefik.backend.port=80"
      volumes:
        - ./config/organizr:/config
        - ./data/organizr:/data
  traefik:
    image: traefik:1.3.3
    command: --web --docker --docker.domain=traefik --logLevel=DEBUG #-c /dev/null --web --docker --logLevel=INFO
    restart: always
    ports:
      - '80:80'
      - '443:443'
      - '8080:8080'
    labels:
      - "traefik.enable=false"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./traefik.toml:/traefik.toml
      - ./config/traefik/data:/data
      - ./config/traefik/sslcerts:/ssl

My traefik.toml

# defaultEntryPoints must be at the top because it should not be in any table below
defaultEntryPoints = ["http", "https"]
InsecureSkipVerify = true

[web]
# Port for the status page
address = ":8080"

# Entrypoints, http and https
[entryPoints]

  # http should be redirected to https
  [entryPoints.http]
  address = ":80"
    [entryPoints.http.redirect]
    entryPoint = "https"

  # https is the default
  [entryPoints.https]
    address = ":443"
    [entryPoints.https.tls]
      [[entryPoints.https.tls.certificates]]
      CertFile = "/ssl/tls.crt"
      KeyFile = "/ssl/tls.key"
[retry]

# Enable ACME (Let's Encrypt): automatic SSL
# [acme]
# # caServer = "https://acme-staging.api.letsencrypt.org/directory"
# email = "test@gmail.com"
# storage = "acme.json" # or "traefik/acme/account" if using KV store
# entryPoint = "https"
# onDemand = false
# OnHostRule = true

[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "localhost"
watch = true
exposedbydefault = false

So I have only 1 app who work like a charm: emby.

Adminer semms to work correctly, load css and others assets, but when I submit the form, it send me to localhost/server=db&username=test it should send me to localhost/dbadmin/server=db&username=test

When I access to localhost/cloud/ it load me a blank page, if I open console of Chrome:

pydio.material.min.css Failed to load resource: the server responded with a status of 404 () pydio.boot.min.js Failed to load resource: the server responded with a status of 404 () 
cloud:18 Uncaught ReferenceError: PydioBootstrap is not defined at cloud:18 pydio.material.min.css Failed to load resource: the server responded with a status of 404 ()

In fact it try to load plugins from localhost/plugins and not from localhost/cloud/plugins ... I see a lot of issue on github related to this but it seems to be corrected in 1.3.3 version, I try 1.3.3, latest...

Do pydio and adminer needs to support reverse-proxy?

Sorry for my bad english.

1 Answers

In traefik, PathPrefixStrip and redirects in the entrypoint do not currently work together. So if your request goes to http instead of https, you'll get an error.

In my own demo, I just setup nginx on port 80 to send the redirect as a short term workaround until the above issue gets fixed.

Related