cloudflare dns error 521
Hi, when I host my website in vercel, I need to make ssl full. when I do, the api I made with nodejs gives 521 host error. but when I do flexible, the api side works and the vercel side breaks. how can I fix this?
8 Replies
Your API needs to support https/443. If you don't have a certificate, under SSL/TLS -> Origin Server you can get one trusted by the CF Proxy valid for up to 15 years
I made it
You should only ever use Full (Strict), Flexible is connecting to your origin insecurely/over plain text. With Vercel this is causing https/secure redirects
he's accessing the site on full right now. but no api login.
Your nodejs api supports https on 443 w/ a valid cert? Test locally and double check firewall, 521 means it can't connect: https://developers.cloudflare.com/support/troubleshooting/cloudflare-errors/troubleshooting-cloudflare-5xx-errors/#error-521-web-server-is-down
Cloudflare Docs
Troubleshooting Cloudflare 5XX errors · Cloudflare Support docs
When troubleshooting most 5XX errors, the correct course of action is to first contact your hosting provider or site administrator to troubleshoot and …
Full is over HTTPS but no checking of the certificate (anyone can mitm and serve any cert), it'll be enough to fix your infinite redirect issue but it's not secure, only full (strict) is secure.
thank you ❤️ I will try