A company's primary web application is served through an Amazon CloudFront distribution with an Application Load Balancer (ALB) as the custom origin. During peak traffic events, the ALB occasionally returns HTTP 502 (Bad Gateway) errors. To maintain a good user experience, the SysOps administrator wants to configure CloudFront to serve a static maintenance page hosted in an Amazon S3 bucket when these errors occur. How should the administrator configure the CloudFront distribution to meet these requirements?
- AConfigure an Amazon Route 53 active-passive failover routing policy that routes traffic to the S3 bucket when the ALB is unhealthy.
- BModify the ALB target group health check path to point directly to the static maintenance page hosted in the S3 bucket.
- Create an origin group containing the ALB as the primary origin and the S3 bucket as the secondary origin, then configure failover criteria to include the 502 status code.Cevap
- DCreate a CNAME record at the zone apex in Route 53 pointing to the S3 bucket static website endpoint to redirect users when the ALB returns a 502 status code.
Cevap
Create an origin group containing the ALB as the primary origin and the S3 bucket as the secondary origin, then configure failover criteria to include the 502 status code.
Creating a CloudFront origin group with the ALB as the primary origin and the S3 bucket as the secondary origin allows CloudFront to fail over automatically. When the primary origin returns an HTTP 502 status code, CloudFront requests the content from the secondary origin (S3 bucket), ensuring that the maintenance page is served to the viewer.
Adım Adım Çözüm
Anahtar Kavram
CloudFront Origin Groups and High Availability