Search code examples
linuxapachecurlnginx

curl: (7) Failed to connect to port 80, and 443 - on one domain


This question shows research effort; it is useful and clear

I have checked the cURL not working properly

When I run the command curl -I https://www.example.com/sitemap.xml

curl: (7) Failed to connect

Failed to connect on all port

this error only on one domain, all other domain working fine, curl: (7) Failed to connect to port 80, and 443

Thanks...


Solution

  • After many search, I found that Hosts settings not correct

    Then I check nano /etc/hosts The Domain point to wrong IP in hosts file

    I change the wrong IP and its working Fine

    This is new error Related to curl: (7) Failed to connect