Reputation: 3
(warning, I'm an AWS rookie) I have an S3 bucket set up for static web page hosting, and an Elastic Beanstalk (php) instance available through an EC2 instance.
What I'd like to do with a CloudFront distribution///
Everything under: http://(cloudfront_domain)/* is ditrected to the S3 bucket,
-except-
everything under: http://(cloudfront_domain)/one_folder/* is directed to the EC2 instance
Upvotes: 0
Views: 337
Reputation: 19738
This is possible by adding the EC2 instance as an origin (Use EC2 instance Public DNS) and creating a Cache Behavior with a Path Pattern routing that /one_folder*
to the EC2 origin.
For more complex routing rules, you can also consider using Lambda@Edge.
Upvotes: 1