2017-07-08 18 views
0

我正在嘗試使用docker構成的traefik。traefik:如何在使用docker-compose時使用基本身份驗證?

據我看到在其網站上線,你可以使用這樣的事情:

mytest-steph: image: myimage ports: - "45001:45001" labels: - "traefik.backend=test_steph" - "traefik.frontend.rule=Host:test.mydomain.com;PathPrefix:/myprefix" - "traefik.backend.port=8080" - "traefik.frontend.auth.basic=test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/"

但是當我啓動泊塢窗,構成了起來,我得到: WARNING: The apr1 variable is not set. Defaulting to a blank string. WARNING: The H6uskkkW variable is not set. Defaulting to a blank string. WARNING: The IgXLP6ewTrSuBkTrqE8wj variable is not set. Defaulting to a blank string.

有沒有人實現使用這樣的基本身份驗證?

回答

0

格式化您的標籤:

labels: 
    - traefik.backend="test_steph" 
    - traefik.frontend.rule="Host:test.mydomain.com;PathPrefix:/myprefix" 
    - traefik.backend.port="8080" 
    - traefik.frontend.auth.basic="test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/" 
2

我已經找到了答案:你必須仔細艾利 「$」 字符。

例如:

  • 「traefik.frontend.auth.basic =測試:$ $ APR1 $ H6uskkkW IgXLP6ewTrSuBkTrqE8wj /」

WILLE成爲:

  • 「traefik。 frontend.auth.basic = test:$$ apr1 $$ H6uskkkW $$ IgXLP6ewTrSuBkTrqE8wj /「
相關問題