[英]AWS ALB using path-based and port-based routing at the same time
I have two apps in ECS configured to expose different ports (app1 at 3000 and app2 at 8080).我在 ECS 中有两个应用程序配置为公开不同的端口(app1 在 3000 和 app2 在 8080)。 I would like to expose app1 at the endpoint
https://<alb dns name>/app1
and the other at http://<alb dns name>:8080
. I would like to expose app1 at the endpoint
https://<alb dns name>/app1
and the other at http://<alb dns name>:8080
.
I've configured an https listener with a certificate and set the path to point to the app1's target group.我已经使用证书配置了 https 侦听器,并将路径设置为指向 app1 的目标组。 Then I setup a port 8080 http listener to route to app2's target group.
然后我设置一个端口 8080 http 监听器路由到 app2 的目标组。 App1 resolves fine at the path, however requests to app2 time out.
App1 在路径上解决得很好,但是对 app2 的请求超时。
I have verified that both apps are accessible to the alb (and both show healthy in their TGs).我已经验证了这两个应用程序都可以被 alb 访问(并且都在他们的 TG 中显示健康)。 If I configure app2 to use path-based routing I can connect to it (however I don't want to do that; app2 needs to be served from
/
).如果我将 app2 配置为使用基于路径的路由,我可以连接到它(但是我不想这样做; app2 需要从
/
提供服务)。 If i configure the http 8080 listener to just return a fixed response, it still times out (does not return the response).如果我将 http 8080 侦听器配置为仅返回固定响应,它仍然超时(不返回响应)。 I'm unable to remove the https listener to test, as that's a production app with a uptime guarantee.
我无法删除 https 监听器进行测试,因为这是一个有正常运行时间保证的生产应用程序。 For testing I added a ALL/0.0.0.0/0 SG to both the ALB and both apps.
为了测试,我向 ALB 和两个应用程序都添加了 ALL/0.0.0.0/0 SG。
Is this a rule of ALBs that I'm unaware of (can't do both at the same time), or an I just doing something wrong?这是我不知道的 ALB 规则(不能同时做两者),还是我只是做错了什么?
I am not sure if you already did, but you need to update the ECS service of app2, in 'Configure ELB' section, select application load balancer in ELB type section, select your new listener port , ALB & target group.我不确定您是否已经这样做了,但是您需要在“配置 ELB”部分中更新 app2 的 ECS 服务,在 ELB 类型部分中的 select 应用程序负载均衡器,select 您的新侦听器端口、ALB 和目标组。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.