Error: REST API generated an error, Your website could not perform the loopback request for one of the hosting the same website, how to fix?

Error: REST API generated an error, Your website could not perform the loopback request for one of the hosting the same website, how to fix?
There is one and the same site on two hosts, one test, and another in which the site should work

so on the test:
5e96486797912801908217.png
so on the second:
5e964871c5351696966290.png

php version is different, but they were the same at the time the error occurred, I updated in an attempt to remove the error
In PageSpeed Insights, the second gives this error:
Lighthouse returned error: FAILED_DOCUMENT_REQUEST. Failed to load page. Make sure that URL entered correctly and the server responds to all requests. Read more: net::ERR_TIMED_OUT.Close

I don't know if, but it's only when you inspect an https version of the site, if I enter http, there is no error.
And a test site without a certificate at all at the moment.
The second site certificate from Let's Encrypt received via the hosting panel, and the second site worked fine for 15 days,and now here such trouble
Can you please tell what could it be?
I suspect that this is problem with hosting
April 19th 20 at 12:03
2 answers
April 19th 20 at 12:05
Hello!
1) the problem with the hosting
2) eliminate CORS, once you have https not working but http works. Maybe you static give over http which occurs in CORS https version
For starters eliminate it.
April 19th 20 at 12:07
Good day!

To solve the problem follow the points (from more simple to more complex):

1. Make a backup of the site files and the database the current state of the site.
2. Make sure that on all domains is valid certificate. Most often, hosting is available LetsEncrypt free certificates - release and install valid certificates. To verify the validity of the certificate online on the site https://www.sslshopper.com/ssl-checker.html
3. On the website, configure redirect from HTTP to HTTPS. This can be done in hosting control panel in the www domain settings or through file .htaccess:

Redirect example No. 1:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTP:CF-Visitor} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Redirect example No. 2:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Redirect example No. 3:
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

4. Download the plugin "Really Simple SSL" install and move the website to HTTPS. And change links site xn--_-7sbbf2b7bj7b on https://xn--_-7sbbf2b7bj7b - it can be done in the database (table wp_options), or in the panel CMS /wp-admin

Check to see if it fixes the error.

5. In the child wordpress theme file with custom functions disable CORS policy.
An example of how to do this are presented in the link https://www.coditty.com/code/enable-cors-on-wordpr...

6. Make sure that you don't have the blocking REST API plugin security.
For example iThesmes Security has the option of locking data requests.

Find more questions by tags WordPressHosting