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
gefragt vor 2 Jahren15878 Aufrufe
2 Antworten
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
beantwortet vor 2 Jahren
profile picture
EXPERTE
überprüft vor einem Monat
  • 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
beantwortet vor 5 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen