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
feita há 2 anos15879 visualizações
2 Respostas
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
respondido há 2 anos
profile picture
ESPECIALISTA
avaliado há um mês
  • 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
respondido há 5 meses

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas