The redirection of a subdomain does not work while the server is working perfectly, I have a domain site.lol and I want a subdomain api.site.lol redirecting on another server so a different IP but I get the error 521. I have verified all possibilities in my server like fail2ban and some other stuff but I didn’t find
Thank you for asking.
Regarding Cloudflare 521 error, may I ask which suggestions from below article for have you tried for further troubleshooting?
Before moving to Cloudflare, was your sub-domain working over HTTPS connection with a valid SSL certificate?
Is your sub-domain hostname like
Kindly, before doing anything at Cloudfalre settings, you could determine if you have a valid SSL certificate installed at the origin host/server by your web hosting provider or your own VPS/dedicated server following the steps from below:
- Use the “Pause Cloudflare on Site” option from the Overview tab for your domain at dash.cloudflare.com .
- The link is in the lower right corner of that page.
- Give it five minutes to take effect, then make sure site is working as expected with HTTPS.
- Check with your hosting provider / cPanel AutoSSL / ACME.sh / Certbot / Let’s Encrypt or some other and renew it accordingly.
- Only then should you un-pause Cloudflare and double-check your SSL/TLS setting to make sure it’s Full (Strict).
May I ask what SSL option have you got selected under the SSL/TLS tab at Cloudflare dashboard for your domain ( Flexible, Full, Full Strict … )?
Here is a way to re-check if you correctly setup the SSL for your domain with Cloudflare:
In case you do not have an SSL certificate, you can use Cloudflare SSL, if so, kindly make sure you follow the instructions as follows on the below article to setup an SSL certificate using Cloudflare Origin CA Certificate:
Last but not least, kindly have a look here for more information regarding correct SSL settings at the SSL/TLS tab on Cloudflare dashboard:
Furthermore, do not skip below step and kindly re-check if Cloudflare is allowed to connect to your origin host to as follows in the below article:
Nevertheless, Cloudflare IP addresses list can be found here:
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.