Cloudflare works fine in DNS only mode.
If You want to use cloudflare optimization, make sure You disable cache, apps & performance through a page rule (also turn off rocket loader).
Apart from this, You have to resolve user’s original IP instead of cloudflare proxy IP so that they’re not rate limited due to many requests coming from same IP.
That’s one way to over-complicate things.
I’ve had issues trying to get it work right in the past and won’t really recommend it unless you’re up for some unexpected adventure every now & then.