Error 504 sometimes from pagseguro

I am sorry to hear that you are experiencing issues/errors with your Website while using Cloudflare service.

May I ask have you checked below article for some usefull information regarding 504 Timeout error:

Otherwise, it could be some hosting issue due to Web server or PHP.
It could be that your origin host / server obviously cannot handle all the requests made to it (be it for example PHP, etc.).
Cloudflare will only wait 100 seconds for the request to complete.
Do you run some script which takes longer than that?

Do you get some errors shown up in your console of your Web browser?
Any erros at error.log file?
Have you tried contacting your hosting provider?

Furthermore, this issue can be either on the host’s end or Cloudflare’s end. To find this out you can temporarly try to disable by switching your records to :grey: or choose the option Pause the Cloudflare for your domain to bypass Cloudflare and try to see if the same happens again.

May I ask you to post what is your result when you visit yourdomain.com/cdn-cgi/trace ?

Nevertheless, have you checked if you block any Cloudflare connections to your origin host / server?

  • or your ISP provider blocked something, possibly …

In case I would suggest to re-check if Cloudflare is allowed to connect to your origin host to as follows in the below article::