我正在尝试在单个EC2实例中部署多个带有嵌入式tomcat的Spring启动Web应用程序。
使用嵌入式tomcat(我更喜欢将我的应用程序运行时解耦),这些应用程序中的每一个都应该在不同的端口上运行(让我们说8081,8082和8083)。
对于这些应用中的每一个,我想指出一个域名:
您是否认为可以继续使用单个实例?
我不确定CloudFront + ELB是否可以解决问题。
答案 0 :(得分:0)
You can't do this with a Classic Load Balancer, but you can do it with a Application Load Balancer.
ALB supports host-based routing, so create one route for each hostname. Each route will have an associated target group, and all 3 target groups can point to the same instance but different ports.
You can do the same thing with paths if you don' want different domains - i.e. you can have domaine.com/app1, domaine.com/app2 and domaine.com/app3 each associated with different target groups.