I'm using Aapanel 6.8.23, Centos 7 OS, Nginx 1.21.0. The problem is that on all wordpress subdomains it always occurs Rest API cUrl error 7 Failed to connect <subdomain name> port 443:Connection refused (http_request_failed).

I have tried most of the solutions on this forum, but to no avail. the only way to work is to add each subdomain name to /etc/hosts in the 127.0.0.1 section, so it becomes :
127.0.0.1 localhost
127.0.0.1 subdomain1.sample.com
127.0.0.1 subdomain2.sample.com
127.0.0.1 blabla.sample.com, ......and more
Of course, this is completely ineffective, especially if you have to register dozens of subdomains. Please help me to get the solution.