CloudFront CDN


CloudFront を経由しないアクセスのブロック

記事


カスタムエラーレスポンス


署名(有効期限)付きURL、署名付きCookie


不明なAWSアカウントIDのCloudFront

問題:

対処:


アクセスログと検索


Basic認証

記事:


トラブルシューティング


証明書のpublic keyサイズは2048bitまで

4096bitの証明書はACMへインポートはできるが、CloudFrontでは使えない。


https対応

httpsコンテンツ中にhttpが混ざると警告を発する。


キャッシュの削除

# curlでキャッシュの状態を確認
curl -I https://example1234.cloudfront.net/path/to/image.jpg
...
X-Cache: Hit from cloudfront

# distribution-id一覧
AWS_PROFILE=default
aws cloudfront list-distributions --profile $AWS_PROFILE --query 'DistributionList.Items[].[Id,DomainName,Origins.Items[].DomainName]'

# distribution-idとpathを指定してキャッシュを削除
aws cloudfront create-invalidation \
 --distribution-id ABCD1234 \
 --paths /path/to/image.jpg \
 --profile $AWS_PROFILE

# invalidationsの一覧と進行状況表示。Status: Completedなら完了
aws cloudfront list-invalidations \
 --distribution-id invalidation \
 --profile $AWS_PROFILE

# curlでキャッシュの有効期限が切れた事を確認
curl -I https://example1234.cloudfront.net/path/to/image.jpg
...
X-Cache: Miss from cloudfront

S3 + CloudFront時にindex.htmlの省略

CloudFront Functionsを使う方法:

Lambda@edgeを使う方法:

Custom OriginでS3バケットを指定 + CloudFrontの場合はサブページ以下のindex.htmlも読んでくれるようだ。(未確認)


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2024-02-08 (木) 14:36:20