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.