HTTP 415 Unsupported Media Type vs 521 Web Server Is Down
HTTP 415 (Unsupported Media Type) is a 4xx Client Error response, while 521 (Web Server Is Down) is a 5xx Server Error response. 415 indicates that the server refuses to accept the request because the Content-Type is not supported. In contrast, 521 means that cloudflare-specific. The origin server refused the connection.
Description
The server refuses to accept the request because the Content-Type is not supported.
When You See It
When sending JSON to an endpoint that only accepts XML, or missing the Content-Type header.
How to Fix
Set the correct Content-Type header matching the data format you're sending.
Description
Cloudflare-specific. The origin server refused the connection.
When You See It
When Cloudflare can't establish a TCP connection to the origin server.
How to Fix
Check that the origin server is running and the firewall allows Cloudflare IPs.
Key Differences
415 is a 4xx Client Error response, while 521 is a 5xx Server Error response.
HTTP 415: The server refuses to accept the request because the Content-Type is not supported.
HTTP 521: Cloudflare-specific. The origin server refused the connection.
You encounter 415 when when sending JSON to an endpoint that only accepts XML, or missing the Content-Type header.
You encounter 521 when when Cloudflare can't establish a TCP connection to the origin server.
When to Use Which
For 415 (Unsupported Media Type): Set the correct Content-Type header matching the data format you're sending. For 521 (Web Server Is Down): Check that the origin server is running and the firewall allows Cloudflare IPs.