I run behind Cloudflare and that's definitely not the problem. I had something similar when I was setting up and it was nginx not passing the true IP to Lemmy so it was hitting limits on requests from a single IP address.
Lemmy Support
Support / questions about Lemmy.
I’m seeing only partial federation on my instance. I see some posts but the comments are sporadic and I’m not sure why. I am also behind cloudflare. If you find more details, please do share so we can get up and running!
Cloudflare shouldn't impact federation at all. I have my instance behind Cloudflare and it works fine. If disabling Cloudflare made it work for you, it might be that the DNS records did not have enough time to update. Or maybe it was HTTPS related and you needed to change some Cloudflare SSL/TLS settings.
When I set up my instance, I don't remember having any trouble with the Cloudflare proxy whatsoever. It's completely compatible with Lemmy.
Seconding this; Cloudflare should not create issues with federation unless your configuration at Cloudflare is blocking inter-server communication. This is more likely to be some other issue instead.
Maybe something with WebSockets? Try creating an instance on your local machine and see what error it gets when it tries to access your real one.
Are you using Docker?