amazon web services - How to check if CloudFront is failing over to another active distribution? -
i have website s3post.cf gets .json.gz
aws cloudfront distribution has s3 bucket origin.
i've enabled cross-region replication bucket another bucket , set second cloudfront distribution.
on route 53, created health check associated file in first bucket cloudfront.s3post.cf
, setup cloudfront failover -
- the second distribution
backup.s3post.cf
has simple routing policy cloudfront distribution's domain name. - the first distribution
post.s3post.cf
has primary failover policy associated above mentioned healthcheck. post.s3post.cf
has secondary failover policy usesbackup.s3post.cf
(the second distribution) alias.
to test setup, removed public permissions health check file. health check failed , site still alive. however, .json.gz
file in both buckets public i'm not sure if failover succeeded.
how can test if post.s3post.cf
failed on backup.s3post.cf
? can't delete .json.gz
file it's deleted in second bucket due cross-region replication.
a check of cloudfront access logs show requests still being served primary distribution. attempting fails take account how cloudfront decides distribution handles given request -- isn't through dns.
cloudfront uses only host:
header sent browser, decide distribution services each incoming request.
as long dns cname resolves any cloudfront distribution, request still arrives @ cloudfront -- cloudfront, web server or proxy, remains unaware of resolution path. knows site browser thinks wanted -- hostname showing in address bar. that's distribution serving requests, regardless of how dns configured.
this strategy not work.
Comments
Post a Comment