【发布时间】:2018-01-17 04:34:32
【问题描述】:
我正在使用 docker swarm 并部署 3 个 tomcat 服务,每个服务在容器内的 8443 和主机容器上的 8444,8445,8446 上运行。
我希望使用在 8443 上运行的代理服务器,它将根据 url 路径将传入的请求重定向到相应的服务
https://hostname:8443/a – > https://hostname:8444/a
https://hostname:8443/b – > https://hostname:8445/b
https://hostname:8443/c – > https://hostname:8446/c
我的示例 Docker-compose 文件
version: "3"
services:
tomcat1 :
image: tomcat:1
ports:
- "8446:8443"
tomcat2 :
image: tomcat:1
ports:
- "8444:8443"
tomcat3 :
image: tomcat:1
ports:
- "8445:8443"
我已经探索过 traeffik 和 nginx,但无法找到基于 url 的重新路由。任何建议。
【问题讨论】:
标签: docker nginx docker-swarm traefik