I migrated a very old static site from a web server to an S3 bucket. The site had been working fine with Cloudflare until I made this change. It is very old and was initially created on a very early version of RapidWeaver. As part of the migration, I upgraded to RapidWeaver 8.
The S3 Bucket URL is: http://www.tuck2000.com.s3-website-us-east-1.amazonaws.com
The raw site with this long URL is viewable on any modern browser Mac or PC.
I configured Cloudflare in a very basic way (CNAME to S3, SSL from Cloudflare, etc.)
Only works on Firefox for some reason.
Firefox can display the site fine (Mac or PC) yet no other browser can view it. Edge, Chrome, Opera, Safari, Mac/PC/iOS makes no difference. I just get garbage per the screen shot below.
Looks okay on Safari on iPad.
Which link works on your iPad? The top one or the bottom one? How about as https?
Does it work if you turn off Cloudflare? click on the orange cloud inside the DNS settings.
Works fine with Cloudflare turned off. But the issue is that there must be something strange in the HTML that is causing it to fail. I have other sites working perfectly fine using an S3/Cloudflare architecture.
How can I debug/fix this. I haven’t used RapidWeaver probably over 10 years and I can’t remember how to find where to manually tweak the underlying theme.
I posted this problem also in the CloudFlare forum and someone responded that the content-encoding header syntax is invalid. This would point to a problem with the RapidWeaver theme, no?
Here is that thread: https://community.cloudflare.com/t/cloudflare-breaks-all-browsers-except-firefox/104745
Narrowing down the problem…
Set up a new bucket in a different region… then everything works fine (https://tuck2000.com). Incidentally I manually uploaded the files through the S3 front-end.
Manually uploading the files to the www.tuck2000.com bucket also seems to get rid of the gibberish. This points to HOW RapidWeaver uploads the files to an S3 bucket.
I have now narrowed it down to a very repeatable series of steps to break and then fix the problem.
- Amazon S3 Bucket - Configured for Static Website Hosting
- Cloudflare - Enabled with CNAME pointing at S3 Bucket
- RapidWeaver - Press Publish or Re-Publish All Files, Method = Amazon S3
This will upload with no error messages. The site will work with the direct Amazon S3 link, the site will work in Firefox via Cloudflare, but will be completely garbled in every other browser (Mac/PC) per the attached screen shot at the top of the thread.
FIX = Export Site and Manually Upload files via Amazon S3 front end.
You can then break it again by Publishing via the RapidWeaver app.
My conclusion is that the method that RapidWeaver uses to update the files to S3 has some problem. Whatever this problem is, affects how Cloudflare caches the pages.
this sounds like something that @tpbradley should hear about
@bor Sorry to hear you’re having issues.
We’re investigating now, and will hopefully get to the bottom of it shortly. Look out for an update in the coming weeks.
Thanks Dan. Let me know if you want any sample files or anything to help.
So even when publishing to a server with FTP, you have to publish to a DNS record that has Cloudflare turned off. So when I publish to my site,
weavers.space. I publish to something like
server.weavers.space. Inside Cloudflare, I have that DNS record disabled for CF.
I hope that makes sense.
Was publishing directly to an S3 bucket (CF was not involved in the middle in any way)
It would be interesting to get zipped versions of both exports. Publish the site via RapidWeaver and download the entire site off S3. Then do an export from RapidWeaver to a different folder. Zip both of those up and we can look at the diffs. In theory, they should be identical.
Another thing to look at are the S3 permissions and whatnot. Are they different when uploaded via RapidWeaver vs manually?
I think I found the problem…
Raw upload goes here: http://test.tuck2000.com.s3-website-us-east-1.amazonaws.com
With this you have Cloudflare in between: https://test.tuck2000.com
The files look identical but if you go into S3 and check the file attributes, when uploading with RapidWeaver there are two attributes:
The Content-Encoding key is there, but has no value
When this occurs, only Firefox can display the site via Cloudflare, you get garbage on the other browsers.
Deleting that metadata key solves the problem!
The thing that RapidWeaver needs to do to fix this is to make sure that key is not set or set correctly (not sure what the right value is).
Can you give the new build of 8.3 a try @tpbradley has re-written the Amazon S3 upload mechanism, fingers crossed it should now work for you. Grab the new build here: 🔥 RapidWeaver 8.3 Final Candidate 4 (Build 20796b)
Hmmm… tried the latest build 20796b and got a “Couldn’t sign in to your HTTPS server - Access Denied” and then a crash. Exact same credentials and settings work fine from Cyberduck.
Thanks for reporting this @bor. Can you try clicking the “Test” button in the publishing settings? If this succeeds, could you try clicking the “Browse” button and let me know what happens.
Also, which region is your S3 bucket in?