This configuration should be possible using a combination of Route 53 aliases, S3 redirection, and CloudFront behavior.
1 Configuring CloudFront Distribution with Multiple Types of Origins and Path Matching Behavior
, , "-" , "" "media". CloudFront . ,
CloudFront.
CloudFront, :
http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CreatingDownloadDistributions.html
- "-"
- , .
- /static/ * "" , . , /media/ * "media". , , "-" .
2 CloudFront
CloudFront, "cloudfront.net". CloudFront , CNAME, "www.mydomain.com" DNS- CloudFront. CloudFront , www.mydomain.com.
: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html
- CloudFront "" . "" "www.mydomain.com"
- "mydomain.com" 53 RRSet CNAME, www.mydomain.com " ", CloudFront . " " "" .
, www.mydomain.com, CloudFront, . , "mydomain.com" . , www-lyzer Route 53 S3.
3 www-a-lizer "mydomain.com" Route 53 S3
Route 53 Alias S3, , :
http://aws.typepad.com/aws/2012/12/root-domain-website-hosting-for-amazon-s3.html
- S3 "mydomain.com" , S3.
- "mydomain.com" "www.mydomain.com". , -, S3, " ". " -". " " :
<RoutingRules>
<RoutingRule>
<Redirect>
<HostName>www.mydomain.com</HostName>
</Redirect>
</RoutingRule>
</RoutingRules>
- Route 53, "mydomain.com" RRSet :
: 'mydomain.com'
: 'A'
: ""
:
- , "mydomain.com" CloudFront. CNAME, 2, CNAME . , .
S3 , . , S3 CDN . . CDN, , ( ). , ( "mydomain.com" ), "www.mydomain.com".
POST CloudFront. CloudFront cookie , . auth , CloudFront. CloudFront POST . script POST, POST CloudFront DNS. 'Post.www.mydomain.com.