Can ALB route traffic except path?

0

I want to route traffic with path "/apps1/hello/world" to apps1 "/hello/world". Is it impossible with ALB rules?

질문됨 2년 전396회 조회
1개 답변
0

Hi,

if I understand correctly, you would like to strip off part of the path and forward only the other part, like a rewrite you may have in Apache or Nginx.

ALBs don't support URI rewriting. I've used different approaches (depending on the use case):

  1. you can install and manage an Nginx or Apache proxy downstream of your ALB, to get the requests and rewrite the URIs based on your configuration;
  2. you can use Cloudfront ahead of your ALB, and use a Lambda@Edge to intercept your requests and rewrite the URIs before sending them to the ALB.

If you have a single domain with different backends and the ALB needs to know the "first block" of URI to know where to route the request, you need to follow case n.1

If you have a single backend downstream of your ALB and need to get rid of a legacy URI scheme, you can choose case 2. You can find an example here: https://dev.to/aws-builders/use-aws-cloudfront-functions-for-uri-rewrites-587d

Hope it helps

profile picture
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인