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?
No description
No description
No description
8 Replies
Fr3zy
Fr3zyOP5mo ago
No description
Chaika
Chaika5mo ago
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
Fr3zy
Fr3zyOP5mo ago
I made it
Chaika
Chaika5mo ago
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
Fr3zy
Fr3zyOP5mo ago
he's accessing the site on full right now. but no api login.
Chaika
Chaika5mo ago
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 …
Chaika
Chaika5mo ago
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.
Fr3zy
Fr3zyOP5mo ago
thank you ❤️ I will try
Want results from more Discord servers?
Add your server