HTTP 405 Method Not Allowed vs 521 Web Server Is Down
HTTP 405 (Method Not Allowed) is a 4xx Client Error response, while 521 (Web Server Is Down) is a 5xx Server Error response. 405 indicates that the HTTP method is not allowed for the requested resource. The response includes an Allow header listing valid methods. In contrast, 521 means that cloudflare-specific. The origin server refused the connection.
Description
The HTTP method is not allowed for the requested resource. The response includes an Allow header listing valid methods.
When You See It
When sending POST to a read-only endpoint, or DELETE to a non-deletable resource.
How to Fix
Check the Allow response header for supported methods. Use the correct 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
405 is a 4xx Client Error response, while 521 is a 5xx Server Error response.
HTTP 405: The HTTP method is not allowed for the requested resource. The response includes an Allow header listing valid methods.
HTTP 521: Cloudflare-specific. The origin server refused the connection.
You encounter 405 when when sending POST to a read-only endpoint, or DELETE to a non-deletable resource.
You encounter 521 when when Cloudflare can't establish a TCP connection to the origin server.
When to Use Which
For 405 (Method Not Allowed): Check the Allow response header for supported methods. Use the correct HTTP method. For 521 (Web Server Is Down): Check that the origin server is running and the firewall allows Cloudflare IPs.