

Note: When you use the Amazon S3 static website endpoint, connections between CloudFront and Amazon S3 are available only over HTTP. To use HTTPS for connections between CloudFront and Amazon S3, configure an S3 REST API endpoint for your origin. Use the Amazon S3 console to create a bucket and to enable static website hosting on the bucket.From the Static website hosting dialog box, copy the Endpoint of your bucket without the leading The format is similar to.You need the endpoint in this format for a later step. Add a bucket policy that allows public read access to the bucket that you created.

Note: For this configuration, the S3 bucket's block public access settings must be disabled. It's a best practice to use SSL (HTTPS) for your website.If your use case requires the block public access settings to be enabled, use the REST API endpoint as the origin and restrict access by an origin access identity (OAI).įor Origin domain, enter the endpoint that you copied in step 2. To use a custom domain with HTTPS, select Custom SSL certificate. You can choose Request certificate to request a new certificate. Using a website endpoint as the origin, with access restricted by a Referer header If you aren't using a custom domain, then you can still use HTTPS with the domain name for your distribution. This configuration restricts access by setting up a custom Referer header on the distribution, and then uses a bucket policy to allow access only for requests with the custom Referer header. Important: Be sure to evaluate whether the access allowed by this setup meets the requirements of your use case.įor Origin domain, enter the endpoint that you copied in step 2. Note: Don't select the bucket from the dropdown list. The dropdown list includes only the S3 Bucket REST API endpoints that aren't used in this configuration. Under Add custom header, choose Add header.įor Value, enter a customer header value that you want to forward to the origin (S3 bucket).
