Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have static content that is being served by Cloudflare. Cloudflare points to Amazon S3 to pick up the static content and serves it via a CNAME ( The bucket is setup properly and everything was working fine for months until Friday when I started getting requests timing out in my browser. I verified that the content was still accessible via S3 and opened a ticket with Cloudflare. Cloudflare reported that "it does appear something at Amazon is likely blocking requests from our IPs" and that they were seeing the following messages in their logs:

upstream timed out (110: Connection timed out) while reading response header from upstream 
upstream prematurely closed connection while reading response header from upstream 

Here is what I already had in my CORS file.


Should I put a * in AllowedHeader? Do I need to explicitly name the Cloudflare IP addresses? What am I missing to avoid the block?

share|improve this question
Did you get this figured out? I'm seeing the same problem. – Brandon Aug 5 '14 at 21:44

Is there any reason you're not using an Amazon CloudFront distribution backed by an S3 bucket to serve up your static content? Should be more efficient than CloudFlare -> S3, and if Amazon are indeed blocking CloudFlare from accessing S3 (though this doesn't make much sense why they'd do this), this would no longer be an issue for you.

You'd also be able to CNAME your hostname to [distribution_id] to preserve your URL scheme and keep the transition transparent to your users. CloudFront operates in a very similar way to CloudFlare, in that their IP addresses are BGP routed to the nearest location worldwide, however Amazon will have more efficient CloudFront -> S3 fetching systems internally.

And as far as I remember, transfer between S3 and CloudFront is free, so you'd be paying not much more (if anything) for bandwidth.

share|improve this answer
The transfer between S3 and CloudFront is free but there is an additional cost for using CloudFront. CloudFlare was free to use and had more coverage. – JStark Jul 17 '14 at 14:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.