2017-08-08 76 views
0

我在羣中使用Traefik時遇到了一些問題。通過以下配置,我預計端口80上的流量將達到traefik服務,然後將其發送到代理服務上的專用端口,但似乎流量並未通過。在多端口後端羣模式下運行traekif

traefik: image: traefik:1.3.5 command: --web --docker --docker.swarmmode --docker.watch --docker.domain=app.dev --logLevel=DEBUG ports: - "80:80" - "8080:8080" volumes: - /var/run/docker.sock:/var/run/docker.sock - /dev/null:/traefik.toml deploy: replicas: 1 placement: constraints: [node.role == manager] restart_policy: condition: on-failure

proxy: image: 'myapp/proxy' deploy: replicas: 1 labels: - "traefik.backend=proxy" - "traefik.web.frontend.rule=Host:www.app.dev" - "traefik.web.port=8000" - "traefik.wss.frontend.rule=Host:wss.app.dev" - "traefik.wss.protocol=ws" - "traefik.wss.port=9002" - "traefik.api.frontend.rule=Host:api.app.dev" - "traefik.api.port=8002" - "traefik.lnr.frontend.rule=Host:lnr.app.dev" - "traefik.lnr.port=9001" restart_policy: condition: on-failure

我在日誌中輸入以下內容:

 
[email protected] | time="2017-08-08T11:27:34Z" level=debug msg="Filtering container without port and no traefik.port label app_proxy.1" 

我收到了404當我發送到應用程序的請求:

 
curl -H "Host:www.app.dev" http://localhost 
404 page not found 

是針對單個多端口在Swarm環境中考慮後端,與Docker Compose一起運行?

任何想法我在這裏失蹤?

回答