Unable to Access ALB URL Configured with Host-Based Routing Rule

0

I have set up an Amazon EC2 instance behind an Application Load Balancer (ALB) in the AWS US East region. The ALB DNS name is test-alb-XXXXXXXXX.us-east-1.elb.amazonaws.com.

I configured a listener with a rule based on host-based routing, where the condition is "HTTP Host Header is test.test-alb-XXXXXXXXX.us-east-1.elb.amazonaws.com".

Despite these configurations, I'm unable to access the URL test.test-alb-XXXXXXXXX.us-east-1.elb.amazonaws.com. Encountering DNS_PROBE_FINISHED_NXDOMAIN error in chrome Could someone please assist me in identifying what might be missing or incorrectly configured? Let me know if I need to add more information, Thank you.

2回答
0

Hello.

"elb.amazonaws.com" is a domain managed by AWS, so you should not be able to create and access a subdomain from this domain.

If there is a possibility that you can connect, try setting the host header using the curl command as shown below.
ALB's host-based routing probably looks at the host header and sorts the connections, so if you set the host header, you may be able to connect.

curl -H 'Host:test.test-alb-XXXXXXXXX.us-east-1.elb.amazonaws.com' test-alb-XXXXXXXXX.us-east-1.elb.amazonaws.com
profile picture
エキスパート
回答済み 2ヶ月前
profile picture
エキスパート
レビュー済み 2ヶ月前
0

If the ALB name is 'test-alb-XXXXXXXXX.us-east-1.elb.amazonaws.com', then that is the default name you need to access it with, not a sub-domain e.g. 'test.test-alb-XXXXXXXXX.us-east-1.elb.amazonaws.com.'. Change your listener rule to not match on any Host header, but to unconditionally forward to your target group.

I see you had an NXDOMAIN - that is because your client could not resolve 'test.test-alb-XXXXXXXXX.us-east-1.elb.amazonaws.com.'. ALB DNS matching the ALB name is added to DNS for you, but not a sub-domain 'test'.

AWS
回答済み 2ヶ月前
profile picture
エキスパート
レビュー済み 2ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ