After upgrading to Discourse 3.5.0.beta8-dev, LW2333 began experiencing Cloudflare 521 errors (“Web server is down”) when using Full (Strict) SSL mode, though switching to Flexible mode temporarily resolved the issue. They confirmed using a Cloudflare Origin Certificate (not Let’s Encrypt), stored in /var/discourse/shared/standalone/ssl/, and rebuilt the app after verifying the config. LotusJeff reported no issues on the same version with Full (Strict) and suggested checking Let’s Encrypt setup or firewall rules, noting that 521 often indicates the server isn’t properly configured for HTTPS. LW2333 clarified they’re not using Let’s Encrypt and shared their app.yml config, which includes cloudflare.template.yml and web.ssl.template.yml. LotusJeff reminded them that Cloudflare certs typically expire every 90 days (though LW2333 confirmed theirs are valid for 15 years and tried regenerating them without success). LW2333 then asked if switching to Let’s Encrypt would resolve the issue, to which LotusJeff advised uncommenting both the Let’s Encrypt template and setting LETSENCRYPT_ACCOUNT_EMAIL in app.yml, while cautioning that manual SSL customizations must be reverted. They also recommended monitoring the rebuild process for Let’s Encrypt errors.
After updating my Discourse site to 3.5.0.beta8-dev, I’m suddenly getting a 521 “Web server is down” error when accessing the site through Cloudflare. This is unexpected since I had previously configured it according to this guide, and it had been working perfectly until now.
Then I tried changing the SSL/TLS encryption mode in Cloudflare from Full (Strict) to Flexible, and the site loaded again.
Does anyone know why this might be happening after the update?
Is there something new in 3.5.0.beta8-dev that could affect Cloudflare compatibility or HTTPS handling?
Any help or suggestions would be greatly appreciated!
Working from memory, cloudflare certs have a 90 day duration. This will require you to create new certs every 3 months. Do you remember how old your certs are?
The default setting is to use Let’s Encrypt. The system will auto renew your certs for you. One less thing to manage manually.