Acquia and AWS CloudFront CDN

Acquia and AWS CloudFront CDN

2 posts / 0 new
Last post
amitabh@kirana11.com's picture
amitabh
Points: 4
Acquia and AWS CloudFront CDN

Here I am stating the steps I had performed.

CloudFront Setup
General

Distribution ID   E2FKNINAA5EJN7
ARN                   arn:aws:cloudfront::XXXXXX:distribution/E2FKNINAA5EJN7
Delivery Method   Web
Cookie Logging   Off
Distribution Status Deployed
Price Class   Use All Edge Locations (Best Performance)
State           Enabled
Alternate Domain Names (CNAMEs)
www.kirana11.com
SSL
Certificate Default CloudFront Certificate (*.cloudfront.net)
Domain Name XXXXXX.cloudfront.net
Supported HTTP Versions HTTP/2, HTTP/1.1, HTTP/1.0
IPv6 Enabled
Last Modified 2017-02-27 17:30 UTC+5:30

Origin

Origin Domain Name    kirana11.com
Origin ID                     Custom-kirana11.com
Origin SSL Protocols   TLSv1.2 TLSv1.1 TLSv1 -SSLv3
Origin Protocol Policy  HTTPS Only
HTTP Port                  80
HTTPS Port                443

Behaviour

Path Pattern                   Default (*)
Origin                             Custom-kirana11.com
Viewer Protocol Policy     Redirect HTTP to HTTPS
Allowed HTTP Methods   GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE
Cached HTTP Methods   GET, HEAD (Cached by default) +OPTIONS
Forward Headers             Whitelist
Whitelist Headers            CloudFront-Forwarded-Proto Host Origin
Object Caching               Use Origin Cache Headers
Minimum TTL                 0
Maximum TTL                31536000
Default TTL                    86400
Forward Cookies             None (Improves Caching)
Query String Forwarding and Caching                 None (Improves Caching)
Smooth Streaming          No
Restrict Viewer Access   No
Compress Objects Automatically   Yes

Now, we have installed Drupal CDN module in Acquia Dev Environment (Reference article: http://wimleers.com/article/easy-drupal-cdn-integration-for-fun-and-profit ) and set
1. Mode as “Origin Pull”
2. CDN Mapping as http://XXXXXX.cloudfront.net
3. Checked Far Future expiration
4. Checked CDN supports HTTPS

When we try to access our dev website now, it cracks up:

[root@ip-10-1-47-241 ec2-user]# curl -I https://XXXXXX.cloudfront.net
HTTP/1.1 502 Bad Gateway
Content-Type: text/html
Content-Length: 587
Connection: keep-alive
Server: CloudFront
Date: Mon, 27 Feb 2017 12:58:39 GMT
X-Cache: Error from cloudfront
Via: 1.1 f87340008385102f85bd0f8550db60b1.cloudfront.net (CloudFront)
X-Amz-Cf-Id: -wzglKM_0yugIFhQpVn5i7OAVJq5ucvZ3WpTg7GHAI66FMRkRHbf2Q==

CloudFront View

Dev Site

As you can see entire website has jumbled.

So, I have a few questions:
1. Anyone configured AWS CloudFront CDN with Acquia?
2. Is my CloudFront setup Ok or did I make any mistake?
3. I have set the Origin as kirana11.com (which is our production), and the dev site URL is http://kirana11XXXXXX.devcloud.acquia-sites.com, is i t because of this URL mismatch CloudFront is throwing 502?
PS. We have provisioned SSL certificate from a trusted CA, so that is not the case.

Please help!!! I am at a loss and no idea how to proceed.

Status: 
Unresolved
amitabh@kirana11.com's picture
amitabh
Points: 4

Just tried with Dev site name on CloudFront origin, it did not work out

kirana11@$ curl -I https://XXXXXX.cloudfront.net
HTTP/1.1
404 Not Found
Content-Type: text/html
Content-Length: 970
Connection: keep-alive
Server: nginx
Date: Tue, 28 Feb 2017 04:23:54 GMT
ETag: "57a300d5-3ca"
Age: 68
X-Cache: Error from cloudfront
Via: 1.1 0a022269c1c06f0aece01340d126af78.cloudfront.net (CloudFront)
X-Amz-Cf-Id: pNwwE7B5YUtyr6sQdPSjALHb7qNMx-aA3iYtv44U5RSIkitok4ELhw==
Attachments: 
Status Change: 
Unresolved