CloudFlare proxy (orange cloud) causing uploading file fail (AWS S3)

Hi, I have a discourse running on a DigitalOcean droplet installed using the market-app option. If I keep the CF proxy off (gray cloud), file upload through S3 works fine.

If I open the CF proxy (orange cloud), file upload fails and the system suggests “Sorry, there was an error uploading that file. Please try again.”

I installed the - "templates/cloudflare.template.yml" in the app.yml and rebuilt it to make sure everything is updated.

I have tried and tested a million times, and the only thing that is changed is CF proxy. So I’m pretty sure it’s CF proxy causing the failure. My server gets DDoS often so CF proxy is helpful. How should I make it work?

Thank you very much!

Right.

Right.

That just allows Discourse to find the user’s IP address instead of having it show as cloudflare’s IP address.

The best way is to use the gray cloud. But if you want to spend more time on it, you can contrive to disable the various speed-up offerings. There are some topics where it’s discussed.

Sorry I don’t quite follow you on this point, can you clarify? I have to use orange cloud because of ddos. Thanks!

Somewhere in cloudflare (maybe under Speed/optimization?) you should turn off all of cloudflare’s optimizations. And somewhere here are some topics that discuss it, though at first glance finding ones that have actual solutions is not easy. But maybe google “disable cloudflare optimizations”.

Is your DDOS issue real or imagined? Discourse has by default rate limiting (which won’t help with DDOS that’s very distributed). If you’re running a community that attracts DDOS folks then you should know that running Discourse in a way that the IP address isn’t leaked is pretty tricky.

All that to say that I’m currently working on something that has cloudflare using the orange cloud. I’ll double-check that uploads are working.

EDIT: Oh, but I was using direct uploads, not S3 uploads.

1 Like

I tried turning every item off under CF’s “speed” section, but unfortunately, still not working …

Anyone else has the same issue? I think I shouldn’t be the only one …