Error 522 with Nginx & Fail2ban after removing all request limit

Error 522 witn Nginx & Fail2ban after removing all request limit adding ignoreip on fail2ban and checking cloudflare IPs aren’t banned

The servers are on Digitalocean

I use Nginx and Fail2ban

Cloudflare was running correctly during 24h but one day I got a peak of visits and I started to got error 522.

I paused cloudflare and trying to solve the problem.

  • I added ignoreips on jail.conf

ignoreip =

  • I removed all request limit on nginx.conf and domain configuration file


#limit_req_log_level warn;
#limit_req_zone $binary_remote_addr zone=reqlimit:10m rate=5r/s;
#limit_conn_zone $binary_remote_addr zone=connlimit:100m;
#limit_conn servers 1000;


  #Rate Limiting
  #limit_req zone=reqlimit burst=20 nodelay;
  #limit_req_status 460; # Status to send
  #Connections Limiting
  #limit_conn connlimit 20; # Number of downloads per IP
  #Bandwidth Limiting
  #limit_rate 4096k; # Speed limit (here is on kb/s)
  • I checked that cloudflare IPs aren’t on iptables list

  • Restarted nginx and fail2ban

But, as soon as I reactivated cloudflare I got again error 522.

Any idea about what can I do for avoid 522?

Is there a way to test the connection between cloudflare and the web server without activate Cloudflare?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.