Error 521 using Cloudflare SSL "Full" option but sort of working using "Flexible" option

Linode Staff

Whenever I connect my instance to my domain through CloudFlare, I get error 521. When I change SSL/TLS mode to Flexible instead of Full, it does load pages, but pages are distorted. All content is distorted.

1 Reply

As Cloudflare explains on their Community Site, a 521 error indicates that Cloudflare was not able to connect to your site. They also explain that their SSL Flexible option will establish an HTTPS connection between Cloudflare and the client, but Cloudflare will connect via HTTP to your server. This would lead me believe that your site is being served via HTTP and not HTTPS, which would explain why Cloudflare can't connect to the Linode in Full mode.

As a first step, I would recommend you check if your site is running in HTTPS. A quick way of doing this might be to visit your IP directly from your browser using https://yourip. You can also check inside the Linode to see if you see port 443 is being used by the web server by running the following command:

ss -plunt | grep 443

If you want to know how to serve your site via HTTPS, we have a guide you can use as reference:

Secure HTTP Traffic with Certbot

We also have a guide on setting up SSL with Cloudflare in case you'd like to have more information:

Set up SSL with Cloudflare

Once your site is good to go with HTTPS, CloudFlare shouldn't have an issue when trying to connect to your site in Full mode.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct