Facing intermittent 524 errors when using Full encryption mode

I have a site configured with Cloudflare. It points to a Tomcat server hosted on a VPS.

When I configure the encryption type as Full, approx. 2% of requests fail with error code 520 or 524. There is no pattern. Any of the API calls randomly fails. But when I use encryption mode as Flexible, there are no failures.

To confirm that the problem is not with the domain or Tomcat server, I temporarily disabled Cloudflare for the site and there were no failures. I saw many community questions having similar issues but could not find any working solution. I so thought of asking here. Any solution to this problem?

Hey there,

Request is sent over different protocol to your server when it’s on Full/Flexible.

You may want to check that your server accepts both http and https?

What your site’s domain?

my server accepts both. Domain of my server is 3pagecrm.com and app.3pagecrm.com