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
preguntada hace 2 años15865 visualizaciones
2 Respuestas
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 hace 2 años
profile picture
EXPERTO
revisado hace un mes
  • 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 hace 5 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas