Cloudflare load balancer 521 error but my server is ok


#1

Hi everyone,
i have set up a load balancer in order to have a failover solution, the health monitor that checks the servers returns that they are running fine, but there is an issues when i try to access it through the url.
when i type the url that i have configured in the load balancer it is presenting the 521 error.
i have searched online for a solution and i have tried to allow all the cloudflare ip’s in the NGINX.
and it still doesn’t work
any ideas?

by the way, it worked for me on aws route 53, that it why it is wierd


#2

Most common reason ist that Cloudflare IPs are blocked or HTTPS is not alowed / configured.

Did you walk through this tips?


#3

Hey ,
I have walked through the steps, I allowed everything in the configuration of my application so that there won’t be any doubt.

Do I have to enable HTTPS ? Or it can be with HTTP also ?

I can send you the configuration that I am using.


#4

No, HTTPS is not necessary. But you should use it.

Any firewall in place? Hardware, or software like iptables or Windows Firewall? Double you use Railgun?


#5

there is no firewall, i use NGINX as a reverse proxy and everything is allowed through it.
any ideas?


#6

I am also having the same issue after going through walkthrough and tips


#7

i managed to fix it, if you want i can try to help you


#8

Well then: Please let us know. :slight_smile:
This would also help others


#9

so, i have looked again at the http and https point that you have pointed out.
i have found out that when i use the balancer is routing traffic through cloudflare then it uses HTTPS, but my server is not with ssl enabled for now.
what i have done is i disabled the traffic through cloudflare and it magically worked. (because it is not longer https).