Nginx error 499 trigger Cloudflare retry that duplicates our orders

Hi, we’re experiencing an error that is maybe related to some sort of timeout I cannot find in CF’s website settings.

Sometimes when users complete an order on our website the backend is slow, this seems to trigger a Cloudflare timeout that makes CF drop the connection and retry. On our server we see a 499 error in the nginx log when this occurs. The problem is that this retry is creating many identical orders.

How can I stop this from happening? If I can do this in a rule for some specific URL this would be better, but I’m willing to drop this behaviour site wide if it’s the only way to fix the error.

Thanks