问题标签 [aws-alb]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
656 浏览

amazon-route53 - 我们可以为同一个 ALB 添加多个 A 记录吗?

我有一个正在运行的应用程序负载均衡器,它将流量重定向到我的两个实例。假设 xyz.com 将流量重定向到我的实例 1 和 2。我的 A 记录 xyz.com---alburl 工作文件。现在我还有两个实例 3 和 4 以及一个目标组 tg2 。我在负载均衡器中添加了主机路径/自定义规则并转发到 tg2,并且能够使用“xyz.com/custom”访问实例 3 和 4 的服务。我可以再添加一条指向“custom.xyz.com”的记录,该记录重定向alburl/custom吗?

0 投票
0 回答
217 浏览

amazon-ec2 - AWS ALB 注销会话失败

我最近遇到了一个场景,即使在我的站点(从前端)中单击注销链接(域/注销)后,我的会话也会恢复,该链接指向 aws 中具有 cookie(AWSALB、JSESSION 等)的 ALB。基本上会话已恢复即使在单击我的注销链接(来自 UI)之后,我想知道的是,当我在 URL 中强行点击 /logout 时,会话被注销而没有任何问题(会话未恢复),而且,当我测试时并非如此具有指向 ALB 中的一个服务器的主机条目的同一站点,相同的注销链接(来自 UI)可以正常工作,而无需从 sso.js 文件进行任何会话恢复。有人可以帮我找出哪里可能是缺陷。

0 投票
1 回答
1382 浏览

amazon-web-services - Unable to register targets on AWS Target group

I am trying to setup an automated DNS deployment using powershell. I have written a powershell script that creates TargetGroup, registers instances to the TG, creates an ALB and adds a listener to it. Once, that is done, it creates R53 RecordSet and creates an A record to the ALB DNS. I am having issues in having the instances registered to the TargetGroup. This is my code snippet to that section:

It throws below error:

I have checked a similar post here. And the corresponding posts, so far nothing helped. I am wondering if anyone can guide me what am I doing wrong?

I have tried to run each line one by one and that happens to register the instance to the TargetGroup, just the script fails. Instances are t2.micro and they are in running state.

0 投票
0 回答
146 浏览

amazon-web-services - AWS CLI ALB 以 lambda 作为目标创建目标组错误

寻求有关为什么失败的帮助

aws elbv2 create-target-group --name $targetName --target-type lambda

返回

aws: error: the following arguments are required: --protocol, --port, --vpc-id

如果我提供协议、端口和 vpc-id

aws elbv2 create-target-group --name $targetName --target-type lambda --protocol HTTPS --port 443 --vpc-id vpc-1234

返回

An error occurred (ValidationError) when calling the CreateTargetGroup operation: Port cannot be specified for target groups with target type 'lambda'

我被卡住了,我尝试过 json 文件输入,结果相同。创建目标组后,您将无法更改目标类型(我尝试创建 https 然后将其编辑为目标类型,但不支持)

0 投票
2 回答
3417 浏览

amazon-web-services - ALB 未正确传播响应标头

我在 ALB 后面有一个 lambda 目标。我的 lambda 是一个 python lambda。

不过,在使用 curl 访问我的网址时,我收到了一个

NoteContent-Type是一个八位字节流,它会导致浏览器将响应下载为文件而不是显示它。我尝试在响应中添加额外的标头"Foo":"Bar",但它们没有出现在 curl 响应中。ALB 似乎正在吃我的 lambda 提供的标头。我怎样才能解决这个问题?

0 投票
2 回答
1864 浏览

amazon-web-services - 如何将 API Gateway 放在 ALB 前面,然后再放在 ECS/EC2 上?

我正在构建一个解决方案,其中我有 10-15 个微服务 REST 应用程序在 ECS 容器中运行,并且很少会在 EC2 中运行。我使用 Cognito 作为 API Gateway 身份验证。现在 UI 应用程序会将请求发送到 API 网关,然后 API 网关连接到 REST 应用程序并返回响应。

我尝试使用 Cognito 实现 API Gateway 身份验证,并且能够连接到在 EC2 中运行的 REST 端点。

现在我需要一个解决方案,如API Gateway -> Application Load Balancer -> Target Group -> ECS/EC2将在公共子网中运行。

我该如何配置?

我是否遵循正确的方法?

0 投票
2 回答
700 浏览

node.js - 从 nodejs 中的 Lambda 返回音频缓冲区时,AWS ALB 返回 502 Bad Gateway

我有一个lambda函数,它确实返回音频缓冲区作为响应,当我从代码调用lambda时,它工作正常,但是当我在 ALB 后面调用lambda时,我得到一个错误 -

502错误的网关

0 投票
3 回答
7785 浏览

node.js - AWS ALB 从 lambda 返回 502 Bad Gateway

我有一个返回 base64 字符串的 lambda 函数,当我从代码中调用 lambda 时它可以工作,但是当我在 ALB 后面调用 lambda 并且 base64 字符串很大时,ALB 给我错误 502 Bad Gateway。注意:对于小尺寸字符串 ALB 也可以。

0 投票
1 回答
575 浏览

node.js - nodejs中的Lambda响应大小自动超过6MB

我有一个 lambda 函数,我从外部 api 获取大约 2.5 MB 大小的缓冲区,但是当我在 JSON 对象中返回相同的缓冲区时,它变得超过 7.5 MB,这大于 lambda 响应大小(6MB)限制,我不确定它是如何发生的。这是我的代码

0 投票
1 回答
970 浏览

amazon-web-services - 将 S3 用作内部应用程序负载均衡器 (ALB) 应用程序的 CDN 的可能性

对于公共网站,当我们使用面向 Internet 的应用程序负载平衡器时,我们可以选择 cloudfront 作为静态内容的 CDN。使用私有 ALB 的内部网站是否有类似的选项?

Web 应用程序在 ExpressJs 中实现,所有静态文件都从服务器提供,但没有关于如何继续分离这些静态资产以移动到任何 CDN 的线索,因为它不是公共的,并且不能将云端用于私有 ELB。有任何想法吗 ?