Lots of assets randomly returning 500

my initial guess was a cloudflare optimization issue - make sure rocket launcher is disabled (which it probably is but worth a check).

also, i think you might want to configure S3 bucket object storage using Cloudflare R2 if you want to continue using the hardware you are using.

you mentioned in our chat that you are using some donated older SSDs that you installed shortly before this started happening, which is a smoking gun - dell firmware says they are bad, but smartctl shows as ok. i think the dell firmware is blinking orange because it detects high latency and erratic I/O responses or unsupported firmware. discourse asks the drives to read dozens of compiled javascript files all at exactly the same time and older unsupported SSDs can choke under this sudden burst of I/O. the storage controller hangs trying to get the data, timing out after exactly 30 seconds - a common default SCSI/block device timeout.

since the drives hang for 30 seconds, discourse rails/nginx crashes or times out trying to fetch the files and throws a 500 error. cloudflare is likely catching the 500 errors and applying the wrong headers and passing to the browser, thus causes the NS_ERROR_CORRUPTED_CONTENT you are seeing.

replace those SSDs, or if you must use them, then use an object storage bucket to offload discourse assets and uploads - you can use the Cloudflare R2 free S3 compatible (i have this and it works well). then your server won’t need to read thousands of small files from those failing SSDs because it bypasses the hardware bottleneck for web assets.