AWS网络ALB可以使用端口范围吗?如何使用?
创始人
2024-09-27 18:30:11
0

是的,AWS网络ALB支持端口范围。您可以使用多个目标组,每个目标组使用不同的端口范围,并将它们添加到负载均衡器的监听规则。以下是一个示例:

1.创建两个目标组,分别使用不同的端口范围:

aws elbv2 create-target-group \
  --name target-group-1 \
  --protocol HTTP \
  --port 8080 \
  --target-type ip \
  --vpc-id vpc-xxxxxxxx

aws elbv2 create-target-group \
  --name target-group-2 \
  --protocol HTTP \
  --port 9090 \
  --target-type ip \
  --vpc-id vpc-xxxxxxxx

2.创建一个负载均衡器监听规则,将目标组与不同的端口范围关联:

aws elbv2 create-rule \
  --listener-arn arn:aws:elasticloadbalancing:region:xxxxx:listener/app/testLB/xxxxxx \
  --priority 1 \
  --conditions Field=path-pattern,Values='/target-group-1/*' \
  --actions Type=forward,TargetGroupArn=arn:aws:elasticloadbalancing:region:xxxxx:targetgroup/target-group-1/xxxxxx

aws elbv2 create-rule \
  --listener-arn arn:aws:elasticloadbalancing:region:xxxxx:listener/app/testLB/xxxxxx \
  --priority 2 \
  --conditions Field=path-pattern,Values='/target-group-2/*' \
  --actions Type=forward,TargetGroupArn=arn:aws:elasticloadbalancing:region:xxxxx:targetgroup/target-group-2/xxxxxx

在这个例子中,可以看到使用了两个目标组和两个规则,每个规则与一个目标组相关联。一个目标组使用8080端口,另一个使用9090端口。当请求路径匹配规则'/target-group-1/”时,请求将被转发到目标组1。同样,当请求路径匹配规则'/target-group-2/”时,请求将被转发到目标组2。

相关内容

热门资讯

一分钟了解!wepoker辅助... 您好,这款游戏可以开挂的,确实是有挂的,需要了解加去威信【136704302】很多玩家在这款游戏中打...
玩家必看分享!wepoker透... 玩家必看分享!wepoker透视挂底牌(辅助挂)果然是真的有挂(真的有挂辅助app)1、在插件功能辅...
安装程序教程!wepoker私... 安装程序教程!wepoker私人局辅助挂(辅助挂)确实有挂(有挂辅助辅助教程)1、让任何用户在无需安...
玩家爆料!拱趴大菠萝万能辅助器... 玩家爆料!拱趴大菠萝万能辅助器(辅助挂)本来是有挂(有挂规律辅助攻略)1、很好的工具软件,可以解锁游...
今日头条!wepokerplu... 今日头条!wepokerplus外挂(辅助挂)确实有挂(有挂技巧辅助脚本)1、完成辅助器v3.3的残...
记者发布!fishpoker透... 记者发布!fishpoker透视底牌(辅助挂)切实是真的有挂(有挂方法辅助教程)1. 选牌创建新账号...
查到实测!aapoker脚本怎... 查到实测!aapoker脚本怎么用(辅助挂)果然是有挂(揭秘有挂辅助技巧)1. 选牌创建新账号,点击...
传递经验!wepoker轻量版... 传递经验!wepoker轻量版透视系统(辅助挂)其实存在有挂(有挂功能辅助软件)1、下载好正确养号方...
查到实测!红龙poker辅助器... 查到实测!红龙poker辅助器免费观看(辅助挂)都是是有挂(确实有挂辅助攻略)1、下载好脚本下载之后...
重大消息!wepoker怎么设... 重大消息!wepoker怎么设置房间(辅助挂)都是存在有挂(有挂秘笈辅助教程)1、不需要AI权限,帮...