wp_remote_get - cURL error 28 - only on same domain
On my website I use wp_remote_get to fetch data from mydomain.com/wp-json/wp/v2/pages/75
When I run it on my localhost it works fine, but after sending to production server (mydomain.com) suddenly I’m getting error: ‘cURL error 28: Operation timed out after 5000 milliseconds with 0 bytes received’ + VPS starts acting crazy (100% cpu usage and memory).
It can’t retrieve data from the same domain. When I changed url to some random REST mockup it is working again.
How can I get data from WP REST on the same domain??
(VPS info: debian 9, php 7.3, curl 7.52.1 and latest wordpress 5.2.2)
Thanks in advance!
Topic wp-remote-get curl Wordpress
Category Web