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
demandé il y a 2 ans15878 vues
2 réponses
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
répondu il y a 2 ans
profile picture
EXPERT
vérifié il y a un mois
  • 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
répondu il y a 5 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions