【问题标题】:Wordpress / Site Health / The REST API Error / Loopback ErrorWordpress / 站点运行状况 / REST API 错误 / 环回错误
【发布时间】:2020-11-07 00:04:25
【问题描述】:

你好吗? 使用原生 WordPress 网站健康功能时出现两个错误。

Your site could not complete a loopback request

Loopback requests are used to run scheduled events, and are also used by the built-in editors for themes and plugins to verify code stability.

The loopback request to your site failed, this means features relying on them are not currently working as expected.

Error: cURL error 35: OpenSSL SSL_connect: Connection reset by peer in connection to mydomain.com:443 (http_request_failed)

The REST API encountered an error

The REST API is one way WordPress, and other applications, communicate with the server. One example is the block editor screen, which relies on this to display, and save, your posts and pages.

The REST API request failed due to an error.
Error: cURL error 35: OpenSSL SSL_connect: Connection reset by peer in connection to mydomain.com:443 (http_request_failed)

已经这样做了:

  • 我禁用了所有插件。
  • 我改成了默认主题。
  • 我突然禁用了 CSF 和 ModSecurity。

但没有成功。 我该如何解决这个问题?

【问题讨论】:

    标签: wordpress openssl loopback wordpress-rest-api csf


    【解决方案1】:

    我在本地开发环境中遇到了完全相同的两个关键问题。

    我的默认地址为“http://localhost:8000”的 WordPress 站点在本地 docker 容器中运行,将 extra_hosts 部分添加到 docker-compose.yml 后,问题解决了。

    这是工作的 docker-compose.yml

    version: '3.3'
    
    services:
       db:
         image: mysql:5.7
         volumes:
           - db_data:/var/lib/mysql
         restart: always
         environment:
           MYSQL_ROOT_PASSWORD: somewordpress
           MYSQL_DATABASE: wordpress
           MYSQL_USER: wordpress
           MYSQL_PASSWORD: wordpress
       wordpress:
         depends_on:
           - db
         image: wordpress:latest
         ports:
           - "8000:80"
         restart: always
         environment:
           WORDPRESS_DB_HOST: db:3306
           WORDPRESS_DB_USER: wordpress
           WORDPRESS_DB_PASSWORD: wordpress
           WORDPRESS_DB_NAME: wordpress
         extra_hosts:
           - "localhost:172.18.0.1"
    volumes:
        db_data: {}
    

    请注意,172.18.0.1 是默认的 docker 网关。

    【讨论】:

    • 谢谢!我们必须这样做的原因是什么?我去过很多论坛,出于某种原因,这是我能在上面找到的唯一信息。
    • 我的实际解决方案是将permalink 设置为%post-name
    猜你喜欢
    • 2021-03-21
    • 1970-01-01
    • 2014-10-13
    • 2016-06-17
    • 2015-07-14
    • 2016-04-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多