I'm running a server with Centos 6 and Plesk 11.
I have curl installed and working on all domains except on a domain that has a www. as preferred domain.
[root@www]# curl http://www.exampledomain.com/wp-admin/admin-ajax.php
curl: (7) couldn't connect to host
When I remove www. it does connect but naturally is supposed to be redirected.
[root@www conf]# curl http://exampledomain.nl/wp-admin/admin-ajax.php
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
This problem arose with I got errors from a WordPress plugin that told me Http Loopbacks wheren't working.
EDIT:
[root@www ~]# curl -v http://www.exampledomain.nl/wp-admin/admin-ajax.php
* About to connect() to www.exampledomain.nl port 80 (#0)
* Trying 127.0.0.1... Connection refused
* couldn't connect to host
* Closing connection #0
curl: (7) couldn't connect to host
[root@www ~]# sudo nmap -PN -p 80 -sN www.exampledomain.nl
Starting Nmap 5.51 ( http://nmap.org ) at 2015-06-19 22:11 CEST
Nmap scan report for www.exampledomain.nl (127.0.0.1)
Host is up.
rDNS record for 127.0.0.1: localhost
PORT STATE SERVICE
80/tcp open|filtered http