admin管理员组

文章数量:1352795

I have two apps in AWS.

  • One hosted in AWS S3 and acts as an origin for an AWS CloudFront distribution.
  • Another one hosted in AWS Amplify.

I would like to, based on a specific path, to redirect either to one or the other.

For example, www.domain/users/123 I'd like it to hit the AWS Amplify app. For all the rest, the CloudFront distribution.

I tried doing this with AWS API Gateway and a Lambda attached, but I cannot link the domain to multiple AWS resources.

Is there another way in which I can make this happen?

I have two apps in AWS.

  • One hosted in AWS S3 and acts as an origin for an AWS CloudFront distribution.
  • Another one hosted in AWS Amplify.

I would like to, based on a specific path, to redirect either to one or the other.

For example, www.domain/users/123 I'd like it to hit the AWS Amplify app. For all the rest, the CloudFront distribution.

I tried doing this with AWS API Gateway and a Lambda attached, but I cannot link the domain to multiple AWS resources.

Is there another way in which I can make this happen?

Share Improve this question asked Apr 2 at 1:57 Felipe PeñaFelipe Peña 2,8484 gold badges24 silver badges41 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

You can point your domain at your CloudFront distribution then you have 2 origins - one for your S3 app and one pointing to your Amplify app. Make the S3 origin your default behaviour, then add another behaviour for /users/* (or whatever) and point that at your Amplify origin.

本文标签: amazon web servicesRedirect based on URL to AWS CloudFront or AWS AmplifyStack Overflow