Serving Private Content through AWS CloudFront

Step 1   – Get the private/public keys from AWS Admin console.

Login to AWS Admin console as root user

AWS-admin-console1

Click on “Create New Key Pair”

image

Download Private Key & Public Key files.

image (1)

Step 2   – Get the private/public keys from AWS Admin console.

Using Signed URLs.

$path :-  CDN URL

Using Signed Cookies

We need to generate the Signed URL first and then use them to set cookies from the server side.

Application URL : app1.example.com

CDN’s URL : cdn.example.com .  (This is how we do it and we need to do this because we will not be able to set the cookies for a different domain *.cloudfront.net)

And from the application, we set the following cookies in ‘.example.com’

  • CloudFront-Signature
  • CloudFront-Key-Pair-Id
  • CloudFront-Policy


					

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s