简体   繁体   English

使用 AWS Application Load-Balancer (ALB) 基于路径路由到外部资源

[英]Path-based routing to external resource with AWS Application Load-Balancer (ALB)

I have a working domain, xy, which is tied to an EC2 instance on a VPC.我有一个工作域 xy,它与 VPC 上的 EC2 实例相关联。

I want a path on that domain, xy/z, to be routed to an external, non-AWS (IPv4*) microservice.我希望将该域上的路径 xy/z 路由到外部的非 AWS (IPv4*) 微服务​​。 Can this be done with ALB?这可以用 ALB 完成吗?

I have followed Use Path-Based Routing with Your Application Load Balancer to set up target groups, but can't seem to link them to anything past EC2 instances?我已按照将基于路径的路由与您的应用程序负载均衡器一起使用来设置目标组,但似乎无法将它们链接到任何过去的 EC2 实例?

(*: Would be great to extend with ports, or even (sub)domains, paths, etc.) (*:可以很好地扩展端口,甚至(子)域、路径等。)

The latest AWS Application Load Balancer (ALB) can do the trick.最新的 AWS 应用程序负载均衡器 (ALB) 可以解决问题。 This works for me这对我有用

Follow the steps here,按照这里的步骤,

1. Set up the ALB AWS documentation here, Follow steps up until Listeners tab, 1. 在此处设置 ALB AWS 文档,按照步骤直到 Listeners 选项卡,

https://docs.aws.amazon.com/elasticloadbalancing/latest/application/tutorial-load-balancer-routing.html https://docs.aws.amazon.com/elasticloadbalancing/latest/application/tutorial-load-balancer-routing.html

2. On the Listeners tab, 2.1. 2. 在监听器选项卡上, 2.1。 Modify rules in the Listeners ID修改 Listeners ID 中的规则

在此处输入图像描述

2.2. 2.2. Add Rule:添加规则: 在此处输入图像描述

2.3. 2.3. Point to redirect URL指向重定向 URL 在此处输入图像描述

This should redirect you to external URL这应该将您重定向到外部 URL

I also have similar requirement.我也有类似的要求。 I want to forward request to external AWS TargetGroup to save ConnectionTime and DNS Resolution time.我想将请求转发到外部 AWS TargetGroup 以节省 ConnectionTime 和 DNS 解析时间。 Both the Account infra are within my company network so it will be possible to forward path based request from one aws ALB to another AWS api.两个帐户基础设施都在我的公司网络内,因此可以将基于路径的请求从一个 aws ALB 转发到另一个 AWS api。 I tried to create rule to forward request, there it is asking to select TG which is listing only TGs belong to current VPC.我试图创建转发请求的规则,它要求选择 TG,它只列出属于当前 VPC 的 TG。 Not sure how can i point to TG of another AWS account.不知道如何指向另一个 AWS 账户的 TG。 enter image description here在此处输入图像描述

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

相关问题 基于 AWS Application Load Balancer (ALB) 路径的路由未按预期运行 - AWS Application Load Balancer (ALB) path based routing not functioning as expected AWS ALB 创建基于路径的路由 - 将子目录重定向到根目录 - AWS ALB Create Path-Based Routing - Redirect subdirectory to root AWS 应用程序负载均衡器 (ALB) 基于主体的路由 - AWS Application Load Balancer (ALB) Body Based Routing AWS ALB 同时使用基于路径和基于端口的路由 - AWS ALB using path-based and port-based routing at the same time 基于路径的路由在 AWS 应用程序负载均衡器上不起作用 - Path based routing not working on AWS Application load balancer 如何为 AWS Application Load Balancer 使用基于路径的路由 - How to have path based routing for AWS Application Load Balancer AWS 应用程序负载均衡器路径路由问题 - AWS Application Load balancer path routing issue AWS 负载均衡器基于路径的路由 - AWS Load Balancer Path Based Routing EKS AWS ALB 入口控制器(AWS 负载均衡器控制器控制器)中文件扩展的路径路由 - Path routing for file extension in EKS AWS ALB Ingress Controller (AWS Load Balancer Controller controller) Kubernetes nginx HTTPS 在 AWS 中的基于入口路径的路由 - Kubernetes nginx ingress path-based routing of HTTPS in AWS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM