Configuring Cloudflare DNS to work with AWS S3 static website hosting


#1

Hi,
i have the following problem.
My domain is managed by, let’s say, the A company.
My email is managed in the B company’s server: email are working well.
My website is published in a AWS S3 bucket as a static website: if I use the URL that AWS have given to me, it works.

My DNS configuration on Cloudflare is:

  • No A record is present;
  • 2x CNAME records for root and www;
  • MX and TXT records presents for email;

Email works fine;
Direct URL from Static S3 Website URL works;
Website’s CNAMEs does not works.

Any ideas?


#2

I believe, even without CF, a CNAME to s3 requires the hostname to exactly match the bucket name. So if you want static.example.com the bucket name also has to be static.example.com. Is your configuration different?


#3

Hi Judge.
thx for the reply.

It’s correct.
I have created the bucket with the exact name of the domain, as you have explained.


#4

Any ideas?


#5

Assuming your CNAME is correct it would appear as if Cloudflare simply cant connect to the server.

That could be either a firewall or an SSL issue. Have you made sure Cloudflare is not blocked? What is your SSL mode? Do you have a certificate on your server?

Can you post the CNAME you were given?


#6

The resource that Cloudflare cannot reach are on Amazon AWS.
I’ve configured a static website on S3.
It’s not a permission issue, I can reach the URL that AWS has created for the static website.
In Cloudflare I’ve configured only a CNAME.
No A record on my Cloudflare DNS configuration


#7

You could still have Cloudflare blocked.

I didnt ask about A records.

What is the CNAME in question?


#8

2 CNAME configured for the static website: the root and the www


#9

You said that already and the question was what is the CNAME.