2017-11-04 15 views
3

私は私を怒らせる問題があります。助けてください。Docker-compose traefik PathPrefixStripが正しく動作しない

私は1つの自由なし-IPのサブドメインからのすべての私のアプリを利用したいので、私はtraefikが私のために、私はそのようなすべての私のアプリケーションにアクセスしたいことを行うことができると思います。ここでは

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

は私のドッキングウィンドウです作曲:

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 

マイ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 = "[email protected]" 
# 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 

だから私は魅力のように働くだけで1アプリを持っています:emby。

Adminer SEMMS正しく機能するために、負荷CSSおよびその他の資産が、私は、フォームを送信すると、それは/サーバー=デシベル&ユーザ名=テストをlocalhostに私を送って、それは/ DBADMIN /サーバー=デシベル&ユーザ名をlocalhostに私を送信する必要があります私はlocalhostにアクセスすると、私はクロームのコンソールを開く場合=テスト

は/クラウド/それは、私に空白のページを読み込む:

実際に
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() 

それがローカルホストからローカルホスト/プラグインからプラグインをロードしようとしませ/ cloud/plugins ... これに関連するgithubで多くの問題が発生していますが、 o 1.3.3のバージョンで修正されました。私は1.3.3、最新のバージョンを試しました...

逆プロキシをサポートする必要がありますか?

私の悪い英語のために申し訳ありません。

答えて

0

traefikでは、PathPrefixStripと入力ポイントdo not currently work togetherにリダイレクトされます。したがって、リクエストがhttpsではなくhttpになった場合は、エラーが発生します。

my own demoでは、上記の問題が修正されるまで短期の回避策としてリダイレクトを送信するためにポート80にnginxを設定しました。

+0

私の場合は、http://にアクセスすると、/./traefik.toml:/traefik.tomlを/dev/null:/traefik.tomlで置き換えると同じ問題が発生します。 localhost/dbadminと入力してフォームを送信すると、http:// localhost /?server = db&username = testにリダイレクトされ、プレフィックスPathStripも緩和されます – pseudo

+0

フォームリダイレクトの問題のようです。私はそれがプロキシを介して動作したい場合は、相対パスにリダイレクトする必要があります。パスの先頭に '/'を置くとPrefixStripロジックが壊れます。 Traefikはあなたのhtmlをまったく変更しません。 – BMitch

+0

お返事ありがとうございますので、embyは相対パスを使用し、pydio、nextcloud、または管理者は絶対使用します。私はtraefikが現在のパスで正しいアプリケーションにすべての要求を再ルーティングすることが可能だと思う – pseudo