HTTP

HTTP 307 Temporary Redirect vs 521 Web Server Is Down

HTTP 307 (Temporary Redirect) is a 3xx Redirection response, while 521 (Web Server Is Down) is a 5xx Server Error response. 307 indicates that the resource temporarily resides at a different URL. Unlike 302, this guarantees the HTTP method will NOT be changed. In contrast, 521 means that cloudflare-specific. The origin server refused the connection.

Description

The resource temporarily resides at a different URL. Unlike 302, this guarantees the HTTP method will NOT be changed.

When You See It

When you need a temporary redirect that preserves the request method (POST stays POST).

How to Fix

Follow the Location header using the same HTTP method.

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.

307 is a 3xx Redirection response, while 521 is a 5xx Server Error response.

2.

HTTP 307: The resource temporarily resides at a different URL. Unlike 302, this guarantees the HTTP method will NOT be changed.

3.

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

4.

You encounter 307 when when you need a temporary redirect that preserves the request method (POST stays POST).

5.

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

When to Use Which

For 307 (Temporary Redirect): Follow the Location header using the same HTTP method. For 521 (Web Server Is Down): Check that the origin server is running and the firewall allows Cloudflare IPs.

Learn More