简体   繁体   English

与 ECS 一起使用时,AWS ALB 返回空页面

[英]AWS ALB return an empty page when used with ECS

I am working on containerizing one react app & provision it using ECS cluster with alb.我正在容器化一个 React 应用程序并使用带有 alb 的 ECS 集群来配置它。 Everything looks great but whenever I accessing the ALB DNS in the browser it returns an empty page with 2 words only "react app" I checked health check all the backend instances are healthy and returning 200 code .一切看起来都不错,但是每当我在浏览器中访问 ALB DNS 时,它都会返回一个空页面,其中只有 2 个单词“react app”,我检查了健康检查所有后端实例是否正常并返回200 code

I have used the ec2 instances IP address in the browser and the page loaded completely.我在浏览器中使用了 ec2 实例的 IP 地址并且页面完全加载。

It seem issue with the alb, why not loaded the complete page alb 似乎有问题,为什么不加载完整页面

It should be a problem on how you have configured the DockerFile.您如何配置 DockerFile 应该是一个问题。 You would have added some default route to nginx configuration which displays 'react app'.您可以向显示“react app”的 nginx 配置添加一些默认路由。

To debug, please try to run the DockerFile from your local using Docker Desktop and see if you are able to browse the react app.要调试,请尝试使用Docker 桌面从本地运行 DockerFile 并查看您是否能够浏览 React 应用程序。

If it works fine in your local then for sure 100% it'll work in ECS without any problem.如果它在您的本地运行良好,那么它可以 100% 地在 ECS 中正常运行而不会出现任何问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从Node.js中的Lambda返回音频缓冲区时,AWS ALB返回502 Bad Gateway - AWS ALB returns 502 Bad Gateway when return audio buffer from Lambda in nodejs pouchDB 查询在导出的异步 function 中使用时返回空 object - pouchDB query return empty object when used in an exported Async function 在 AWS ECS Fargate 中运行 Nodejs docker 时出错 - Error when running Nodejs docker in AWS ECS Fargate Puppeteer 的 page.evaluate() 在 Electron 中使用时总是返回空对象 - Puppeteer's page.evaluate() always returns empty object when used in Electron 使用Nginx作为指向AWS ALB的反向代理 - Using nginx as reverse proxy pointing to AWS alb Socket.IO 和负载均衡器 (ALB AWS) - Socket.IO and load balancer (ALB AWS) 使用wait时返回空? - Return empty when using await? node.js 的 AWS SDK 在 ECS 中运行时未获取凭证 - AWS SDK for node.js not picking up credentials when running in ECS Node.Js Express 应用程序在负载均衡器后面的 AWS ECS 上运行时不允许登录 - Node.Js Express app doesn't allow log in when running on AWS ECS behind a Load Balancer 在 aws 上部署时如何使用环境变量 - How environment variables are used when deployed on aws
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM