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.

asked a month ago301 views
2 Answers
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
EXPERT
answered a month ago
profile picture
EXPERT
reviewed a month ago
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
answered a month ago
profile picture
EXPERT
reviewed a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions