cURL 35 Error from WordPress Site Health behind a CDN+WAF Firewall

1.9k views Asked by At

I have my site behind a StackPath firewall (CDN+WAF).

I am getting two errors when I use the native WordPress site health feature.

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)

and

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)

How can I resolve this?

2

There are 2 answers

0
cipher442 On

Since the site is behind a WAF firewall, there is no reason for it to go out to the WAF, and back to perform a loopback. We want it to go directly back to the server.

The solution is to modify the hosts file (/etc/hosts) to resolve each website to the origin IP address.

sudo vim /etc/hosts

Add the site in question to the origin IP address.

Example:

105.67.244.102 mydomain

That's it. The loopback error should be gone.

0
Codemypath On

It depends what you want to achieve.

If you want to monitor your origin server than I would agree with @cipher442

If you want to monitor health of your site while It's behind CDN and WAF than I would recommend one of two possibilities:

  1. Check if Stackpath has some kind of monitoring tools that will do do health checks from multiple locations
  2. Set Datadog or some other third party monitoring that will do monitoring

Third and the only 'free' option is to rely on status code reporting and logs that you are getting for your site on CDN/WAF. If you have resources you can do some self hosted app that will parse those logs and provide you with a lot of details like response time, the most requested url, location of your end users etc..