Support » Fixing WordPress » Error: cURL error 28: Connection timed out after 10001 milliseconds (http_reques

  • kirkofthefleet


    I am having an issue passing the site health check. It is resulting the errors “The REST API encountered an error” and “Your site could not complete a loopback request”. I’ve been reading through posts on this topic and tried all of the suggestions I could find. My site runs on a self hosted server running NGINX 1.16.1, MariaDB 10.5.9, and the latest version of WordPress. I get my SSL certs from certbot so I’m assuming their good (not an expert on any of this).

    I think a clue may be in the error it reports:
    Error: cURL error 28: Connection timed out after 10001 milliseconds (http_request_failed)

    Notice how it says http request failed. Shouldn’t that be https request failed? My NGINX configuration is set so that any requests that come in through http are converted to https. It seems like that would be a reason for the http request to fail if the reply is coming back as https (I hope that makes sense).

    Does anyone know of any way around this? Its not affecting my site (that I can tell) but I’d like to know how to fix it.

Viewing 1 replies (of 1 total)
  • jjberry


    Hi @kirkofthefleet ,
    The error detail “http_request_failed” is missleading you. Either for https or https the error will be the same.

    The problem here could be simply a performance issue. As the error message says, the loopback request is aborting after 10 seconds without receiving a response.
    So, the first thing that I’d try is to extend the timeout limit to something longer than 10 seconds.
    If you are comfortable with some basic coding, you can achieve this by placing the following snippet into your theme functions.php file:

    function __extend_http_request_timeout( $timeout ) {
        return 60; // seconds
    add_filter( 'http_request_timeout', '__extend_http_request_timeout' );

    (if it is third party theme, you will want to create a child theme to avoid lossing your changes, or put this into a custom plugin).

    If you still get a timeout after 60 seconds, then there is definitely something failing in your API endpoint.


Viewing 1 replies (of 1 total)
  • The topic ‘Error: cURL error 28: Connection timed out after 10001 milliseconds (http_reques’ is closed to new replies.