Skip to content

How to design navigation between different areas

0

There is a requirement where a request from my own domain name should be directed to CloudFront, which then forwards it to different domain names based on the request's region. The redirected domain name is not my own. How can I design this requirement

1 Answer
0

To design a solution where requests from your domain are directed to CloudFront and then forwarded to different external domains based on region, you can use CloudFront with multiple origins and path patterns. Here's how to implement this:

  1. Create a CloudFront distribution with multiple origins:
  • Set up each target domain as a separate origin in your CloudFront distribution
  • Each origin would point to the different external domains you need to redirect to
  1. Configure behaviors with path patterns:
  • Create different behaviors in your CloudFront distribution
  • Use path patterns to determine which requests go to which origin
  • For example, "/regionA/" could go to one domain, "/regionB/" to another
  1. Use CloudFront Functions or Lambda@Edge:
  1. Set up your domain:
  • Add your domain as an alternate domain name (CNAME) in the CloudFront distribution
  • Obtain an SSL certificate through AWS Certificate Manager for your domain
  • Update your DNS settings to point your domain to the CloudFront distribution

This approach allows you to maintain a single domain for your users while routing their requests to different external domains based on their region. The user will initially access your domain, but CloudFront will handle the forwarding to the appropriate external domain based on your configured rules.
Sources
cloudfront distribution with several origins | AWS re:Post

answered a year ago

AWS
SUPPORT ENGINEER

revised a year ago

AWS
SUPPORT ENGINEER

revised a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.