Help Center> Content Delivery Network> Troubleshooting> Why Is a 5XX Status Code Returned When I Request Resources from My Acceleration Domain Name?
Updated on 2023-06-26 GMT+08:00

Why Is a 5XX Status Code Returned When I Request Resources from My Acceleration Domain Name?

  1. Visit the origin server to check whether a 5XX error occurs. For details, see How Do I Check Whether an Access Fault Is Caused by the CDN PoP or Origin Server?.

    If the error occurs, check the origin server configuration. Data on the CDN console can help you troubleshoot certain origin server faults.

    • Log in to the CDN console. In the navigation pane, choose Analytics > Origin.

    • Check whether the bandwidth and traffic increase sharply. If the bandwidth and traffic increase sharply, the origin server will be overloaded and the response from the origin server will time out. Check whether resources are updated recently or new cache rules are configured for popular resources. When releasing new resources or functions, prefetch large files to CDN points of presence (PoPs) to prevent bandwidth bottlenecks caused by a large number of origin pull requests.
    • Check whether cache rules are configured on the origin server. If no-cache, private, or no-store is configured on the origin server and Origin Cache Control is enabled on the CDN console (this function is disabled by default), CDN cannot cache content and needs to pull content from the origin server. When a large number of origin pull requests are sent to the origin server, the response from the origin server may time out. For details about how to set cache rules, see Setting the Maximum Cache Age.
    • Check whether the network of the origin server fluctuates. If the carrier network of the origin server is faulty, origin pull times out.

    If the origin server is normal, proceed to the next step.

  2. If the status code 504 is returned, locate the fault as follows.

    Cause: The origin server may not support the protocol used by CDN to pull content.

    1. The origin protocol used by CDN is same as the client access protocol.
      • If a client uses HTTPS to access CDN, CDN will use HTTPS to pull content from the origin server. If the origin server does not support HTTPS, it will return a 504 response.
      • If a client uses HTTP to access CDN, CDN will use HTTP to obtain content from the origin server. If the origin server does not support HTTP, it will return a 504 response.
      • If a client uses HTTP to access CDN and you have configured force redirect to HTTPS on CDN, CDN will pull content from the origin server using HTTPS. If the origin server does not support HTTPS, it will return a 504 response.
    2. The default origin protocol used by CDN is HTTP, but the origin server supports only HTTPS.
    3. The origin protocol used by CDN is HTTPS, but the origin server supports only HTTP.

    Solution: Modify the CDN configuration to match the access protocol supported by the origin server. The default origin protocol used by CDN is HTTP. Change it to a protocol supported by the origin server. For details, see Origin Protocol.

  3. If the status code 502 is returned, locate the fault as follows:
    • Check whether security policies, such as Safedog and firewall, are configured on the origin server to block CDN origin IP addresses.
      • During origin pull, CDN intelligently schedules PoPs to access your origin server, and the IP addresses of the PoPs are not fixed. Configuring fixed PoP IP addresses in origin pull policies may cause origin pull failures.
      • If protection software such as Safedog is required, adjust security policies to avoid incorrect interception.
  4. If the fault persists, submit a service ticket.