3

你好吗?当我使用原生 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。

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

4

1 回答 1

2

在我的本地开发环境中,我恰好遇到了同样的两个关键问题。

我的默认地址为“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 网关。

于 2021-02-10T15:25:46.557 回答