1

We're in the process of moving our server environments to aws from another cloud hosting provider. We have previously been using Cloudfront to serve up our static content, when attempting to retrieve static content from Cloudfront in our new aws setup, we're getting 502 bad gateway errors.

I've done a fair bit of googling around for solutions and have implemented suggestions from the following...

Cloudfront custom-origin distribution returns 502 "ERROR The request could not be satisfied." for some URLs

But still with no luck in resolving 502 errors. I've double checked my ssl cert and it is valid.

Below are my nginx ssl config and sample request / response

Our current ssl settings in nginx

nginx 1.6.1

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

ssl_prefer_server_ciphers on;

ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:RSA+3DES:RC4:HIGH:!ADH:!AECDH:!MD5;

Sample request / response

Request

GET /assets/javascripts/libs/lightbox/2.7.1/css/lightbox.css?v=20141017003139 HTTP/1.1

Host: d2isui0svzvtem.cloudfront.net

Connection: keep-alive

Pragma: no-cache

Cache-Control: no-cache

Accept: text/css,/;q=0.1

User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36

Accept-Encoding: gzip,deflate,sdch

Accept-Language: en-US,en;q=0.8

Response

HTTP/1.1 502 Bad Gateway

Content-Type: text/html

Content-Length: 472

Connection: keep-alive

Server: CloudFront

Date: Fri, 17 Oct 2014 00:43:17 GMT

X-Cache: Error from cloudfront

Via: 1.1 f25f60d7eb31f20a86f3511c23f2678c.cloudfront.net (CloudFront)

X-Amz-Cf-Id: lBd3b9sAJvcELTpgSeZPRW7X6VM749SEVIRZ5nZuSJ6ljjhkmuAlng==

Trying the following yields the same result...

wget https://d2isui0svzvtem.cloudfront.net/assets/javascripts/libs/lightbox/2.7.1/css/lightbox.css

Any ideas on what is going on here?

Thanks in advance.

3
  • Can you do a wget directly against your nginx and paste result? Commented Oct 17, 2014 at 4:38
  • Thanks for your response. I have solved the issue, I had a misconfiguration in Route 53. Commented Oct 20, 2014 at 11:39
  • hello what was the issue please? I have same problem Commented May 1, 2023 at 11:23

2 Answers 2

1

Set "Compress Objects Automatically" to no.

Sign up to request clarification or add additional context in comments.

2 Comments

Can you explain why is this the cause of the problem?
This didn't make any difference for me
-2

make sure Origin Settings->Origin Protocol Policy is set to "HTTPS Only"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.