HTTP

HTTP 411 Length Required vs 521 Web Server Is Down

HTTP 411 (Length Required) is a 4xx Client Error response, while 521 (Web Server Is Down) is a 5xx Server Error response. 411 indicates that the server refuses to accept the request without a Content-Length header. In contrast, 521 means that cloudflare-specific. The origin server refused the connection.

Description

The server refuses to accept the request without a Content-Length header.

When You See It

When sending a request body without specifying Content-Length.

How to Fix

Include a Content-Length header in your request.

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

1.

411 is a 4xx Client Error response, while 521 is a 5xx Server Error response.

2.

HTTP 411: The server refuses to accept the request without a Content-Length header.

3.

HTTP 521: Cloudflare-specific. The origin server refused the connection.

4.

You encounter 411 when when sending a request body without specifying Content-Length.

5.

You encounter 521 when when Cloudflare can't establish a TCP connection to the origin server.

When to Use Which

For 411 (Length Required): Include a Content-Length header in your request. For 521 (Web Server Is Down): Check that the origin server is running and the firewall allows Cloudflare IPs.

Learn More