User akhil is troubleshooting an S3 and CloudFront setup for Discourse, following the official guide but encountering issues where uploads fail to serve from S3. The problem stems from misconfigured environment variables — supermathie clarifies that S3 settings must be set via environment variables (not site settings) when running rake tasks like uploads:migrate_to_s3. akhil attempts to add variables to app.yml, but still faces permission errors. supermathie identifies the likely issue: anonymous users or CDN can’t read from the bucket. After reviewing IAM policies, buckets, and CloudFront distributions, akhil shares detailed setup steps. A breakthrough comes from pfaffman, who suggests using www in the host address — akhil confirms switching from non-www to www resolves the issue, possibly due to SSL or Cloudflare-related conflicts. The setup now works with both S3 and CloudFront serving assets correctly. pfaffman expresses surprise at the fix but is glad it’s resolved. akhil speculates the prior outage may have been tied to Cloudflare’s service disruption.
As I explained here, after I did this, the site was offline. So, I was unable to see the outcome of that. But when I tried the same setup on a test sub-domain, all was working fine. Therefore, I suspect there is something wrong with the SSL.
Based on your clue of www, I changed the host address, and the issue was fixed immediately.