WordPress /站点健康/REST API错误/环回错误

olhwl3o2  于 2022-12-22  发布在  WordPress
关注(0)|答案(2)|浏览(349)

你好吗?我得到两个错误,当我使用本地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)

已经:

  • 我禁用了所有插件。
  • 我已更改为默认主题。
  • 我在whm上禁用了CSF和ModSecurity。

但没有成功,我该怎么解决这个问题呢?

mutmk8jj

mutmk8jj1#

在我的本地开发环境中,我遇到了完全相同的两个关键问题。
我的WordPress站点默认地址为“http://localhost:8000”,在本地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网关。

e3bfsja2

e3bfsja22#

我自己托管WordPress时遇到了这个问题。
这是由我的网络设置造成的。如果您使用的是NAT或您自己的DNS,您将需要进行nat反射或拆分DNS。
您最好的选择是拆分DNS。(您可以根据自己的网络服务器查找如何做到这一点。)
您可以从NetGate找到更多信息,如果使用PFSense,这将解决您的问题。或者希望为您指出正确的方向。
https://docs.netgate.com/pfsense/en/latest/nat/reflection.html

相关问题