ALB Rewrite-path and alter

0

There's requirements that we need to use ALB in front for path fwd+rewrite at the same time, We expect to use same fqdn, and use path to separate environment for dev, uat, and prod.

For Example:

app.com/dev/service1 -> Rewrite to -> service1.app.dev-aws-sg.domain.com/service1

app.com/uat/service1 -> Rewrite to -> service1.app.uat-aws-sg.domain.com/service1

app.com/prod/service1 -> Rewrite to -> service1.prod.dev-aws-sg.domain.com/service1

What should be the good approach for this specific scenario.

Thank you in advanced.

AWS
已提问 2 年前15878 查看次数
2 回答
0

I would say a redirect in the ALB listener configuration would be your best bet https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#redirect-actions

If path =app.com/dev/service1

Redirect to:

Host: service1.app.dev-aws-sg.domain.com

Path:/service1

AWS
AJ_C
已回答 2 年前
profile picture
专家
已审核 1 个月前
  • Hi AJ_C Thank for your reply, We have worked, and check found out to go with adding a proxy in between the ALB and the targets to perform the URI modification.

0

A tad late, but you can also use CloudFront as a front end to your ALB - the ALB becomes the CF origin. Then use a CloudFront Function to perform the URL modification, header updates, etc.

Joe B
已回答 5 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则