ECS 上的 Dockerized React js 站点在可访问时显示不健康
我们在 AWS ECS 上使用负载均衡器对 React js 站点进行了 Docker 化。任务定义在带有 Linux 的 Fargate 上运行。
我们遇到的问题是目标群体总是报告不健康。我们已将运行状况检查路由到站点的专门构建部分以进行运行状况检查。该路径在命中时返回 304。我们已将健康检查范围更改为 200-304。失败的运行状况检查的响应是 404。
作为测试,我们将运行状况检查设置为 404 ==healthy。当我们这样做时,网站保持正常运行,我们能够使用所有功能。我们所做的健康路径也返回了 304,尽管它在健康检查中说它返回了 404。
- 我们已经尝试增加健康检查的超时和宽限期。
- 更改端口(并确保这些端口已打开)
- 更改 /health 所在的位置
- 更改 LB 重定向端口
- 我们已确保映像是最新的工作映像,
- 还在负载平衡和任务上打开了端口 443 和 80。
我们没有主意了,虽然该网站 100% 正常运行,并且 == 404 正常,但我们不想就这样离开。
我们如何才能健康地达到200或304或404以外的任何水平?
We have Dockerized a react js site on in AWS ECS with a load balancer. The task definitions are being run on fargate with linux.
The issue we are having is that the target group is always reporting unhealthy. We have pathed the health check to special built portion of the site just for the health check. That path returns a 304 when hit. We have changed the health check range to 200-304. The response on the failed health checks was a 404.
As a test we set the health check to 404 == healthy. When we did that the site stayed up and we were able to use all functionality. The healthy path we made was returning a 304 as well even though it was saying in the health check it was returning 404.
- We have tried Increasing the timeout and the grace period for the health check.
- changing ports (and making sure those ports were open)
- changing where the /health is hitting
- change the LB redirect port
- we have made sure the image is the most recent working one
- also opened up ports 443 and 80 on the load balance and the task.
We are out of ideas and while the site is 100% functional with a healthy == 404 we don't want to leave it this way.
How can we get healthy to be 200 or 304 or anything other than 404?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,对路由以及我们如何处理路径的做法,它返回了 304,因为当它到达我们为健康检查而放入的路径时,它会经历一个构成 304 的重定向。我们修复了它通过将健康检查指向这些路线前面的某些内容(在我们的例子中为选项卡图像)。
It turns out that do to routing and how we were handling the paths it was returning a 304 because when it would go to hit the path we were putting in for the healthy check it was going through a redirect which constituted a 304. We fixed it by pointing the healthy check at something in front of those route, in our case the tab image.