204 (No Content) responses from origin web server turn into 520 errors when being proxied through Cloudflare. This only happens when the response contains a payload (one character is enough).
Current behavior:
The Cloudflare proxy responds with HTTP code 520 with a message in its body: “Web server is returning an unknown error”.
Expected behavior:
The Cloudflare proxy may forward or ignore the payload and respond normally with 204.
<?php
http_response_code(204);
echo '.';
However, the same script hosted at another domain and web server is responding fine. Both domains have very similar configuration and Caching enabled.
Working example: https://pumsrvld.pumox.com/gp/with-payload.php
This problem may be related to this recent incident: https://www.cloudflarestatus.com/incidents/hljt52nzcsnf