2017-07-31 3 views
0

私はtraefik.tomlを使用せずにtraefikを使用しますが、docker-compose.ymalファイルのみを使用します。私は1つのことを除いて私が欲しいことは何でもすることができました。自動的に1つのサービスをhttpからhttpsにリダイレクトします。 可能ですか?私はHTTPを使用する場合Traefik:docker-compose.ymlだけを使ってリダイレクトする方法は?

は、ここに私のドッキングウィンドウ-COMPOSE(抜粋)

version: '2' 
    services: 
    ################################### 
    # TRAEFIK 
    ################################### 
     traefik: 
      image: traefik:latest 
      command: --web --docker --docker.domain=docker.localhost --logLevel=DEBUG --entryPoints='Name:https Address::443 TLS' --entryPoints='Name:http Address::80' --acme.entrypoint=https --acme=true --acme.domains="${BASE_URL}, ${ADMIN_URL}" --acme.email="${MAIL_ADDRESS}" --acme.ondemand=true acme.onhostrule=true --acme.storage=/certs/acme.json 
      ports: 
       - "80:80" 
       - "443:443" 
      volumes: 
       - /var/run/docker.sock:/var/run/docker.sock 
       - /dev/null:/traefik.toml 
       - $CONFIG_DIR/traefik:/etc/traefik/acme 
       - $CONFIG_DIR/certs:/certs 
      labels: 
       - "traefik.backend=traefik" 
       - "traefik.frontend.rule=Host:${ADMIN_URL}" 
       - "traefik.backend.port=8080" 
       - "traefik.frontend.auth.basic=admin:${passwd_admin}" 
       - "traefik.frontend.entryPoints=https" 
     rutorrent-steph: 
      image: xataz/rtorrent-rutorrent 
      ports: 
       - "45001:45001" #UserPort 
      labels: 
       - "traefik.backend=rutorrent_steph" 
       - "traefik.frontend.rule=Host:${BASE_URL};PathPrefix:/steph_rutorrent" 
       - "traefik.backend.port=8080" 
       - "traefik.frontend.auth.basic=steph:${passwd_steph}" 
       - "traefik.frontend.entryPoints=https,http" 
      environment: 
       - UID=${MYUID} 
       - GID=${MYGID} 
       - PORT_RTORRENT=45001 
       - WEBROOT=/steph_rutorrent 
      volumes: 
       - $DATA_DIR/steph/data:/data 
       - $DATA_DIR/steph/config/torrent:/config 
      dns: 8.8.8.8 

です:// {BASE_URL}/steph_rutorrentまたはhttps:// {BASE_URL}/steph_rutorrent、それはすべての時間を動作します。 // {BASE_URL} /それはhttpsにリダイレクトされますsteph_rutorrent:// {BASE_URL}/steph_rutorrent

+0

あまりにも少ない情報の--entryPoints='Name:http Address::80 Redirect.EntryPoint:https'

。 docker-composeで実行されているサービスに関する情報はありませんか?どのサーバーをリダイレクトするのですか?どのように今のようにリダイレクトしようとしましたか?あなたが助けを得る必要がある場合質問を詳しく述べてください –

答えて

0

は、コマンドにこれを追加してください:

しかし、私は確信して私は、HTTPを入力するとことをしたいのですが代わりに回答する質問の

--entryPoints='Name:http Address::80'

+0

それは魅力のように動作します。ありがとうございました。 –

関連する問題