• dave

    (@mozdzanowski)


    I’m also having a problem with the Cloudflare setup, per the instructions that @ianmjones linked in this post.

    My S3 bucket name is: cdn.domain.com
    My Cloudflare CNAME record is: cdn —> cdn.domain.com.s3-website-us-east-1.amazonaws.com
    I’ve input a custom domain(CNAME) in the plugin options: cdn.domain.com

    None of the images are showing on both the backend and frontend of my site. I get a 522(timeout error) for every image/file on the site. In Inspector the urls are being rewritten(correctly) as such: https://cdn.domain.com/wp-content/uploads/yyyy/mm/xxxxxxxx/filename.jpg

    The files exist in my S3 bucket and I can view all of the files in the bucket.

    I noticed when I click on a file in S3, in the file info, it shows the “Object URL” is: https://s3.amazonaws.com/cdn.domain.com/wp-content/uploads/yyyy/mm/xxxxxxxx/filename.jpg

    Is this the problem? According to the docs mentioned above,

    …prefix your region and bucket name to ‘.amazonaws.com’. For example:

    cdn.delightfuldownloads.com.s3-eu-west-2.amazonaws.com

    …which I have done in the Cloudflare CNAME record, and the plugin seems to be using the correct subdomain since the image urls are being rewritten, but the actual object url to the file is not the same. Does this matter? Why would my images still not be showing? Any thoughts?

    • This topic was modified 4 years, 11 months ago by dave.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter dave

    (@mozdzanowski)

    I also just found this post/comment.

    I had my S3 bucket enabled for “Static website hosting” and just disabled that, but I’m still getting a 522 error on all images.

    Plugin Contributor ianmjones

    (@ianmjones)

    If you’re using the default us-east-1 region, you don’t specify anything bar “s3” as part of the Cloudflare DNS target.

    cdn.domain.com.s3.amazonaws.com

    If your bucket is in a different region than the default, then you use the region…

    cdn.domain.com.s3-eu-west-2.amazonaws.com

    You should **never** include the “-website-” bit, that’s for static website hosting only.

    • This reply was modified 4 years, 10 months ago by ianmjones.

    I have a similar problem to this. I want to use subdomain in the offload media. My S3 bucket is in the default location of us-east-1.
    S3 bucket name cdn.sub.domain.com
    cloudflare CNAME record Name: cdn | content: cdn.sub.domain.com.s3.amazonaws.com | TTL: auto | proxy status: proxied
    cloudflare SSL is full.

    offload media
    Custom Domain (CNAME): cdn.sub.domain.com
    offloadmedia URL preview shows: https://cdn.sub.domain.com/wp?content/uploads/2020/06/03134008/photo.jpg

    I am am not sure what I did wrong but after enabling the custom domain rewrite in offload media all the images on the WordPress media stop showing. when I click the images in the media library I can see details but I can’t see the image preview. all the at media is blank.
    is there any solution. spent lots of time on it still not able to fix it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Images not showing on Cloudflare setup’ is closed to new replies.