2
votes

Basically, I want to redirect every domain name to one virtual host, the documentation seems very clear.

    server {
      listen 80;
      server_name domain1.com www.domain.com domain2.com www.domain.com;
      ...
    }

However, only the first domain1.com works. The rest, www.domain1.com, domain2.com and www.domain2.com don't work at all. Am I doing something wrong? Is there any other settings to input in order to use multiple domains? Thanks!

1

1 Answers

3
votes

Well the config is right, so you either didn't reload the settings

sudo service nginx reload

or the domains don't point to the server, check

user@host:~$ host domain.com
user@host:~$ host www.domain.com

make sure that the IP's match