Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALB does not get requests when using CNAME record, instead it is treated as an S3 request. #1676

Open
barrydunne opened this issue Mar 2, 2025 · 0 comments

Comments

@barrydunne
Copy link

I have a working ALB that I can access using http://local-alb.elb.localhost.localstack.cloud:4566/
My goal is to have different host based rules on the listener to target different ECS services.

As a first step toward this goal I have created a hosted zone in R53 named aws-playground.local
Within that zone I have a CNAME record for test.aws-playground.local that points to local-alb.elb.localhost.localstack.cloud

Running dig on the LocalStack container shows it is available

dig @localhost test.aws-playground.local ANY

;; QUESTION SECTION:
;test.aws-playground.local.     IN      ANY

;; ANSWER SECTION:
test.aws-playground.local. 300  IN      CNAME   local-alb.elb.localhost.localstack.cloud.

On the LocalStack container I can run this command and get the expected response from the ALB

curl http://local-alb.elb.localhost.localstack.cloud:4566/test

I can also run this command and get the expected response from the ALB

curl -H "Host: local-alb.elb.localhost.localstack.cloud:4566" http://localhost:4566/test

But if I run this command I do not get a response from the ALB, instead I get a message saying "The specified bucket does not exist"

curl -H "Host: api.aws-playground.local:4566" http://localhost:4566/test

Outside of docker I have also added an entry in my local hosts file to point api.aws-playground.local to 127.0.0.1 and see the same behaviour.

Is it possible to use a custom domain to access an ALB in LocalStack?
I would be happy to disable the ability to access S3 buckets via domain if that was an option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant