Cloudflare 504 520 errors on XML Sitemap Generator

I have a XML Sitemap Generator that continues to receive 504 / 520 Cloudflare errors from the Gateway with my identification ID.

(HTTP) 504 Gateway Timeout server error response code indicates that the server did not get a response in time from the upstream server that it needed in order to complete the request. .Apparently the problem is a handshake that is not occurring within a Cloudflare 100 second timeframe. Is there a way that Cloudflare can be set to stop this from occurring.

I am a programming novice and need some suggestions.

Thanks, Ed

May I ask if this is a plugin for some CMS like WordPress, or self-made script, or rather some online tool like

If it’s running at your origin host/server, it might indicate your server needs more resources, or more power, even more time as the error states, to generate it successfully and completly in one batch file with all the URLs (up to 50k items as I remember per XML sitemap file or if more than that it should be split by multiple sitemap files, at least for Google).

I might suggest you to temporary enable the “Pause Cloudflare for this site” option from the Overview tab of the Cloudflare dashboard.
Run the process, after finish, un-pause it.

Other workardoun to try out is by temporary switching the DNS records for your domain name from proxied :orange: to :grey: (DNS-only).

Nevertheless, if your PHP settings at your origin server has value of 300 or more, even if you got the error “504 timeout” from Cloudflare, I believe the PHP process still works and does his job in the background until it hits that origin value set for timeout despite the error being shown.

  • you could try to increase the execution timeout in PHP just in case …
1 Like

Thank you for your reply.

I am used the software

The server is networksolutions. I doubt that the origin host/server requires more resources, etc.

The site we are using has less than 2000 pages and is stopped at level 3. It will be only one batch file.

I will try this suggestion. (…suggest you to temporary enable the “Pause Cloudflare for this site”)

I will also try this suggestion. (temporary switching the DNS records for your domain name from proxied :orange: to :grey: (DNS-only).)

How do I find out if my PHP settings on my origin server has a value of 300 or more?

The execution time is currently set at 12000sec.

Regards and thanks again,


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