HTTP状态码说明

Updated at:

Alibaba Cloud CDN returns standard HTTP status codes when errors occur. This reference describes 4xx and 5xx codes CDN may return, explains what each means in the CDN context, and lists concrete steps to resolve it.

4xx status codes

4xx status codes indicate client-side errors.

400

  • Cause: Bad Request

  • Description: The request is malformed or invalid.

  • Explanation: The origin server cannot understand or process the client's request due to a syntax error.

  • Solution: Verify that the request parameters are valid and correctly formatted, and then retry.

401

  • Cause: Unauthorized

  • Description: The request requires user authentication.

  • Explanation: The client did not include valid authentication credentials in the request. The origin server requires authentication to process the request.

  • Solution: Include valid authentication credentials in the request or ensure the request is authorized on the origin server, and then retry.

403

  • Cause: Forbidden

  • Description: Forbidden.

  • Explanation: The origin server understood the request but refuses to fulfill it because the client lacks permission to access the requested resource.

  • Solution: Grant the required permissions for the client request, and then retry.

404

  • Cause: Not Found

  • Description: The requested resource does not exist.

  • Explanation: The origin server could not find the requested resource.

  • Solution: Correct the request URI and retry, or check if the server-side URL path is publicly accessible.

405

  • Cause: Method Not Allowed

  • Description: The HTTP method is not supported for this resource.

  • Explanation: The HTTP request method used by the client, such as GET, POST, or PUT, is not allowed for the target resource.

  • Solution: Change the request method to one that is supported by the origin server, and then retry.

406

  • Cause: Not Acceptable

  • Description: Not acceptable.

  • Explanation: The requested resource cannot be served in a format that conforms to the content negotiation headers specified by the client, such as Accept-Charset or Accept-Language.

  • Solution: Modify the request header fields to a type that is supported by the origin server, and then retry.

407

  • Cause: Proxy Authentication Required

  • Description: Proxy authentication required.

  • Explanation: The client did not provide the required authentication credentials to access the requested resource through a proxy origin server.

  • Solution: Check if the authentication for the proxy origin server has expired. Include the correct credentials issued by the proxy origin server, and then retry.

408

  • Cause: Request Timeout

  • Description: The server timed out waiting for the request.

  • Explanation: The origin server did not receive a complete request within a reasonable time and has closed the connection rather than continue waiting.

  • Solution: Increase the origin server's processing timeout or reduce the request payload size, then retry.

409

  • Cause: Conflict

  • Description: Conflict.

  • Explanation: The request could not be completed because it conflicts with the current state of the target resource. This error commonly occurs in response to a PUT request when multiple clients attempt to edit the same resource simultaneously.

  • Solution: Refresh and resubmit the information, or implement conflict resolution logic on the origin server, and then retry.

410

  • Cause: Gone

  • Description: The resource is permanently removed.

  • Explanation: The origin server uses this status code to inform the client that the requested resource has been intentionally and permanently deleted.

  • Solution: Remove any references to the permanently deleted resource from the client, and then retry.

411

  • Cause: Length Required

  • Description: Length required.

  • Explanation: The client did not specify the length of the request body in the Content-Length header, but this information is required to access the resource.

  • Solution: Include the Content-Length header in the client's request and retry. If the length cannot be determined, use the Transfer-Encoding: chunked header to enable chunked transfer encoding.

412

  • Cause: Precondition Failed

  • Description: One or more preconditions are not met.

  • Explanation: The origin server rejected the request because the resource does not meet the conditions specified by the client.

  • Solution: Include the correct precondition headers in the request, and then retry.

413

  • Cause: Payload Too Large

  • Description: The request payload exceeds the server’s size limit.

  • Explanation: The origin server refuses to process the request because the payload sent by the client exceeds the server's acceptable size limit.

  • Solution: Reduce the file upload size or the amount of submitted data, and then retry.

414

  • Cause: URI Too Long

  • Description: The request URI is too long.

  • Explanation: The origin server refuses to process the request because the URI provided by the client is too long.

  • Solution: Shorten the request URI, or split long parameters into multiple requests and aggregate the results on the client side.

415

  • Cause: Unsupported Media Type

  • Description: The media type of the payload is not supported.

  • Explanation: The origin server refuses to process the request because the format of the payload is not supported.

  • Solution: Modify the Content-Type header in the request to a format supported by the server, and then retry.

416

  • Cause: Range Not Satisfiable

  • Description: The requested range is not satisfiable.

  • Explanation: The origin server cannot fulfill the requested range specified in the Range header of the client request.

  • Solution: Check that the Range header field specifies a valid range. Modify the Range value and retry.

417

  • Cause: Expectation Failed

  • Description: Expectation failed.

  • Explanation: The origin server cannot meet the requirements specified in the Expect header of the client request.

  • Solution: This is common in testing scenarios. If it occurs in production traffic, disable the Expect header in the request.

429

  • Cause: Too Many Requests

  • Description: Too many requests.

  • Explanation: The client has sent too many requests in a given period, as defined by the origin server's rate-limiting rules.

  • Solution: The number of requests has exceeded the origin server's limit. Wait for a period of time before retrying, based on the retry interval configured on the origin server.

499

  • Cause: Client Close Request

  • Description: The client closed the connection before the server could respond.

  • Explanation: This error occurs when the client terminates the connection before the origin server can respond. Since the client actively closed the request, it does not receive an error response, so defining a custom error page is unnecessary.

5xx status codes

500 Internal Server Error

Your origin server encountered an internal error and could not process the request.

Resolution:

  1. Check the origin server's error logs to identify the root cause.

  2. If a recent deployment caused the error, roll back to the last working version to restore service.

  3. Fix the underlying issue and confirm the origin is responding correctly before retrying.

502 Bad Gateway

A CDN POP could not connect to your origin server and received no valid response.

Resolution:

  1. Confirm your origin server is running and reachable.

  2. Check the origin server's firewall rules to make sure inbound traffic from CDN POPs is allowed.

  3. Review the origin server logs for connection errors.

503 Service Unavailable

Your origin server is temporarily overloaded and unable to handle the request.

Resolution:

  1. Check the load on your origin server to identify which application or process is consuming excessive resources.

504 Gateway Timeout

A CDN POP sent a request to your origin server but did not receive a response within the configured timeout period.

Resolution:

  1. Confirm your origin server is available and reachable.

  2. Check origin server performance — slow database queries or long-running processes can cause timeouts.

  3. If the origin legitimately needs more time to respond, increase the timeout period as needed.

508 Loop Detected

A request forwarded by a CDN POP was redirected back into the CDN network, creating an infinite loop that exceeded the maximum redirect limit.

This typically happens when the origin server or a redirect rule sends traffic back to the CDN domain that initiated the request.

Resolution:

  1. Check your origin server and any redirect rules for circular references.

  2. Make sure every loop or redirect chain has a termination condition.

  3. After fixing the loop, retry the request.