我正在尝试在docker swarm中部署Web应用程序。我正在使用Traefik,因为它允许会话粘性。作为前端规则,我包括:" traefik.frontend.rule = PathPrefixStrip:/ TestManager"
/ TestManager是我的服务名称。但是,当我尝试导航到/ TestManager时,我得到了一个糟糕的网关。
这是我的Traefik信息中心:Traefik Dashboard
我不确定是否需要编辑要显示的TestManager页面的前端规则或后端规则。
这是我的docker-compose文件:
version: '3'
services:
testmanager:
image: 10.244.102.10:5000/testmanager
networks:
- net
deploy:
mode: replicated
replicas: 3
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
labels:
- "traefik.docker.network=autoframework_net"
- "traefik.port=80"
- "traefik.backend=testmanager"
- "traefik.frontend.rule=PathPrefixStrip: /TestManager"
- "traefik.backend.loadbalancer.sticky=true"
ports:
- "8080"
loadbalancer:
image: traefik
command: --docker \
--docker.swarmmode \
--docker.watch \
--web \
--loglevel=DEBUG
ports:
- 80:80
- 9090:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock
deploy:
restart_policy:
condition: any
mode: replicated
replicas: 1
update_config:
delay: 2s
placement:
constraints: [node.role == manager]
networks:
- net
网络: 净: