Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
Created June 13, 2016 08:43
Show Gist options
  • Select an option

  • Save tkuchiki/ca648848b586ee4651e2da3dcbfc1332 to your computer and use it in GitHub Desktop.

Select an option

Save tkuchiki/ca648848b586ee4651e2da3dcbfc1332 to your computer and use it in GitHub Desktop.
CloudFront でエラーページを返す

CloudFront で Origin を S3 にしてエラーページを返す

  • Origin Domain Name
    • S3 の Bucket を指定
  • Restrict Bucket Access
    • yes
  • Origin Access Identity
    • なかったら Create a New Identity
  • Grant Read Permissions on Bucket
    • Yes, Update Bucket Policy
  • Alternate Domain Names(CNAMEs)
    • 独自ドメインを使うなら設定
  • SSL Certificate
    • 独自ドメインの SSL を使うなら適宜設定

Error Pages

  • HTTP Error Code
    • 403
  • Customize Error Response
    • yes
  • Response Page Path
    • 適宜設定 (/503.html)
  • HTTP Response Code
    • 503

S3

CloudFront の Response Page Path を /503.html にした場合、
Bucket 直下に 503.html を置く(画像なども必要なら適宜配置)

注意

307 Temporary Redirect を返す場合は、Invalidation してキャッシュを消す。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment