Bad Gateway - error 521 than 502 after setting Cloudflare DNS

May 21, 2018 1.8k views
CDN One-Click Install Apps Ubuntu 18.04

Hello, I linked my domain to my wordpress application and everything works. but when I change the DNS to configure CloudFlare, nothing else works and host error. normally everything works fine i can not find the problem. no firewall and the server is UP.

thanks again

3 Answers

Are you able to access your site by the IP address directly? A 521 error from CloudFlare indicates that your web server refused the request sent through from CloudFlare.

  • Yes the IP work. FInally I swicth to FLEXIBLE SSL and I install Really Simple SSL plugin to my wordpress. Now all work fine.

I had the same problem when I pointed my website to my new IP. Originally I was with SiteGround but switched hosting to a one click WP Digital Ocean install (Ubuntu 18.04). After updating my DNS with CloudFlare my website went down (both 521 & 502 errors). The fix for me was turning SSL to Off (Flexible allowed the site to open but the format was all messed up). I have an active SSL certificate so I am not really clear as to why it wasn't working... Will do some more research but for now I am just glad to have my site back up and running.

I resolve the problem with "Really Simple SSL" plugin WP

Have another answer? Share your knowledge.