How do I route Cloudfront with multiple origins?

9,530

Create a second distribution.

CloudFront can select the origin server based on path pattern matching only -- not the hostname, or other request parameters.

http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesPathPattern

Share:
9,530

Related videos on Youtube

resting
Author by

resting

Updated on September 18, 2022

Comments

  • resting
    resting over 1 year

    So I have 2 Wordpress sites hosted as such

    • http://siteA.mydomain.com
    • http://siteB.mydomain.com

    I have a distribution created that has the 2 domains above as the origin.

    • siteA.mydomain.com
    • siteB.mydomain.com

    I'm not sure how to configure the routes such that http://siteA.mydomain.com/wp-content/* will go to siteA's domain, and http://siteB.mydomain.com/wp-content/* will go to siteB's as the path pattern is the same.

    Or should I create another distribution for siteB?