是否可以将 AWS API Gateway 私有集成与 ALB 集成? VPC 与 ALB HTTPS 监听器链接?

发布于 2025-01-09 06:57:48 字数 867 浏览 4 评论 0原文

我正在尝试实现 this 链接中的模式我们的应用程序位于 API 网关后面。我首先尝试使用端口 80 而不是端口 443 进行相同的模式,以更快地开发并验证一切正常。(如果我将 nginx 代理 sidecar 配置为侦听端口 80,请在我的 alb 配置中为我的 ecs 任务使用 http 侦听器,并使用 http_listener对于 API GW VPC 链接)现在,我想使用 https_listeners 但到目前为止我所尝试的方法不起作用。

当我将 nginx 配置为侦听端口 443、我的 ecs 任务的 https 侦听器并使用 https_listener 作为 API GW VPC 链接时,它不起作用。以下是我尝试过的不同组合:

  • 如果我为端口 80 和 443 添加侦听器规则并将重定向规则附加到 https,我会从负载均衡器收到 301 Moved Permanently 错误,我认为这意味着重定向没有工作。

  • 如果我仅向端口 443 添加侦听器规则,则会收到 400 The plain HTTP request was sent to HTTPS port。

    错误请求

我做错了什么?任何指导表示赞赏。 谢谢!

ALB 架构(ECS)

I am trying to implement the pattern in this link to front our apps behind an API Gateway. I first tried the same pattern with port 80 instead of port 443 to develop faster and verified that everything is working.(If I configure nginx proxy sidecar to listen port 80, use http listeners for my ecs tasks in my alb config and use the http_listener for the API GW VPC Link) Now, I would like to use https_listeners but what I have tried so far did not work.

When I configure nginx to listen on port 443, https listeners for my ecs task and use https_listener for the API GW VPC Link, it does not work. Here are the different combinations I tried:

  • If I add a listener rule for port 80 and 443 and attach a redirection rule to https, I get the an 301 Moved Permanently error from my load balancer, which I believe means that the redirection did not work.

  • If I only add a listener rule to port 443, I get a 400 The plain HTTP request was sent to HTTPS port.

    bad request

What am I doing wrong? Any guidance is appreciated.
Thanks!

ALB Architecture(ECS)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文