I've about 4 different hostnames defined in the sites-enabled/domain.tld files. Each of the files are in the following fashion:
#Redirect everything to the main site.
server {
server_name *.abc.net;
listen 80;
root /var/www/vhosts/abc.net/httpdocs;
if ($http_host != "acb.net") {
rewrite ^ http://abc.net$request_uri permanent;
}
include /etc/nginx/conf.d/restrictions.conf;
#Additional rules go here.
# Only include one of the files below.
include /etc/nginx/conf.d/wordpress.conf;
# W3 Total Cache Rules
include /var/www/vhosts/abc.net/httpdocs/nginx.conf;
}
Each of the server blocks in the site-enabled folder only change the domain name, so abc.net becomes xyz.com and so on.
The problem is that, regardless of all these configuration files in place, all the vhosts just redirect to one vhost. I've tried restarting the nginx server, reloading it, and also rebooted the server.
These requests are sent to an upstream php, running PHP-FPM, if that helps, and all the domains are running wordpress on them.
Appreciate your help. Thank you :)
curl -I test.abc.net
andcurl -I test.xyz.net
HTTP/1.1 301 Moved Permanently Server: nginx/1.0.10 Date: Fri, 30 Dec 2011 08:36:22 GMT Content-Type: text/html Content-Length: 185 Connection: keep-alive Location: http://mariouana.com/
And for another domain on the same nginx server: curl -I geekd.inHTTP/1.1 301 Moved Permanently Server: nginx/1.0.10 Date: Fri, 30 Dec 2011 08:36:31 GMT Content-Type: text/html Content-Length: 185 Connection: keep-alive Location: http://mariouana.com/