如果您在使用AWS Application Load Balancer(ALB)时发现转发规则对路径无效,请检查以下几个方面:
{
"Type": "forward",
"TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:012345678910:targetgroup/my-targets/73e2d6bc24d8a067"
"ForwardConfig": {
"TargetGroups": [
{
"TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:012345678910:targetgroup/my-other-group/938d3fddcdbf3bc9",
"Weight": 2
},
{
"TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:012345678910:targetgroup/my-3rd-group/6837f1d460d5af49",
"Weight": 3
}
],
"TargetGroupStickinessConfig": {
"Enabled": true,
"DurationSeconds": 60
}
},
"Priority": 10,
"Conditions": [
{
"Field": "path-pattern",
"PathPatternConfig": {
"Values": [
"/app1/*"
]
}
}
]
}
describe-target-health
来检查目标组中的实例的状态。aws elbv2 describe-target-health --target-group-arn arn:aws:elasticloadbalancing:us-west-2:012345678910:targetgroup/my-targets/73e2d6bc24d8a067
确保您的应用程序正在正确响应请求。如果您的应用程序不能识别特定的路径或错误地处理请求,AWS ALB将无法正确转发请求。
确认您的VPC网络配置正确。如果您的负载均衡器无法将请求转发到目标组,则您可能需要检查网络ACL、安全组、路由表等。
如果您在检查了以上方面后
上一篇:AWSALB终端节点返回404。