Why would a long running script get a 520 cache error?
I have a script which takes some time to run. And of course it’s being caught by Cloudflare, so I put a page rule in place and set the following settings:
Disable Security, Web Application Firewall: Off, Security Level: Low, Cache Level: Bypass, Disable Performance
Which I expected would allow the script to bypass the rules and run as long as needed but it hasn’t helped.
Here is the error I am getting:
Error 520 Web server is returning an unknown error
There is an issue between Cloudflare’s cache and your origin web server. Cloudflare monitors for these errors and automatically investigates the cause.
I’m assuming the actual error is not cache related but just a run-time length error. I think actually our server tries to re-run script that timeout so perhaps that is why the error is a 520 instead of an actual timeout error.
So my question is: if page rules don’t work, how do I get around the Cloudflare restrictions on certain pages?
I saw another question on this where the solution was to create a subdomain and have the subdomain not run through cloudflare (or not be proxied anyway) but that isn’t really a viable solution, it would mean I would need two versions of our sites as the way our host does subdomains is they treat it as a separate site so now I have 2 versions of our sites with shared resources/global functions needed in both. It’s just not practical or long term viable for our business so I’m hoping there is a better solution than changing hosting.