Error 520 when APO is active

Hello,

In recent days, we are seeing a lot of Error 520 when we have the Cloudflare WordPress APO active. After conducting several tests to isolate the problem, we’ve observed that these errors disappear when the APO function is disabled.
Open to all suggestions.

Hi,

Thank you for reaching out to us. A 520 error (Troubleshooting Cloudflare 5XX errors · Cloudflare Support docs) happens when your origin returns a response that is unexpected.

There are two key instances where this can happen in my experience:

  1. Your web server or networking equipment (Firewall, Load Balancer) reset the TCP connection after it was established. Sometimes when a web server crashes it will reset the connection. Check your web server error log for the timescale that the error occurred in and look for any error messages.
  2. Your web server returned an invalid response that exceeded our limits. Often this can happen if your web server is returning too many/too large headers. This is often caused by runaway scripts that return too many cookies, for example. The Code Igniter PHP framework has some known bugs around this too.

You may also refer to our article here: Community Tip - Fixing Error 520: Web server is returning an unknown error

If this does not solve the issue, can you please submit a ticket so we can check this for you?

Kindly,

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