首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >码头集装箱内的多弹簧防护罩

码头集装箱内的多弹簧防护罩
EN

Stack Overflow用户
提问于 2018-09-27 16:36:10
回答 1查看 271关注 0票数 1

我们玩的是docker和spring boot,这对我们来说还是个新手..

下面是我们的用例:

代码语言:javascript
复制
* There are three Spring Boot based web applications 
  - web1 = works on port 8010 = exposes API as http://...:8010/web1/rest/someEndPoint_1
  - web2 = works on port 8020 = exposes API as http://...:8020/web2/rest/someEndPoint_2 
  - web3 = works on port 8030 = exposes API as http://...:8030/web3/rest/someEndPoint_3

* All of these should be packaged in single docker image 
* Docker may have apache/haproxy/nginx and it should expose port 8080, which 

将映射到8080处的主机端口

代码语言:javascript
复制
* Here is requirement : 

  - If request will come to Docker as http://DOCKER_HOST_IP:8080/web1/rest/someEndPoint_1 
        ==> host will forward traffic to container 
        ==> Proxy running inside container will see pattern 
        ==> http://...:8010/web1/rest/someEndPoint_1

  - If request will come to Docker as http://DOCKER_HOST_IP:8080/web2/rest/someEndPoint_1 
        ==> host will forward traffic to container 
        ==> Proxy running inside container will see pattern 
        ==> http://...:8020/web2/rest/someEndPoint_1

  - If request will come to Docker as http://DOCKER_HOST_IP:8080/web3/rest/someEndPoint_1 
        ==> host will forward traffic to container 
        ==> Proxy running inside container will see pattern 
        ==> http://...:8030/web3/rest/someEndPoint_1

有可能实现吗?(基本上,我们被要求检查是否可以基于URL模式路由流量?)

请随时添加评论/编辑问题!谢谢你,谢谢你。致敬..

EN

回答 1

Stack Overflow用户

发布于 2018-09-27 16:53:09

您正在寻找API网关,它将把传入的请求路由到一点,以提供不同的服务。您应该查看一下Spring Cloud Gateway,看看它是否能满足您的需求。

配置应该非常简单,您将在端口8080上公开您的网关,并配置到所有服务的正确路由。

之后,您将能够将所有apis聚合到一个ip:port

更多信息可以在cloud gateway tutorial上找到。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52532763

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档