Multiple domain on 1 droplet

October 24, 2012 7.8k views
Anybody have multiple domains set up ? Having trouble adding another domainto my vps. It's mdotblog.com Primary domain is studious.net and it is working perfectly, but aditional nothing, not even 'not found', just blank like it doesn't exist at all. Even deleted primary domain and left only mdotblog.com, but nothing still Having nginx and virtual hosts set up.
4 Answers
There are no issues running multiple domains from a single virtual server. Just need to make sure your DNS entries are correct and you have your nginx config properly setup.

You can either paste it here or if you prefer you can open a ticket and we can help you troubleshoot it.
Ina a nutshell ping mdotblog.com
ping: unknown host mdotblog.com

Domains are:
- studius.net
http://www.networksolutions.com/whois-search/studius.net
- mdotblog.com
http://www.networksolutions.com/whois-search/mdotblog.com

DigitalOcean DNS configuration is
http://i.imgur.com/k4t2l.png
http://i.imgur.com/i6dgn.png

Nginx:
#nginx.conf
nclude /etc/nginx/sites-enabled/*;

#site-available and sites-enabled
#studius.net

server {
listen 80;
server_name studius.com;

location / {
root /home/studius;
index index.html index.htm;
}
}

#mdotblog.com
server {
listen 80;
server_name mdotblog.com;

location / {
root /home/valis;
index index.html index.htm;
}
}
Also I opened a ticket couple hours ago as I don't know what to looka at anymore, I've beent trough every inch of configuration I have with not results at all.
I'd suggest you create a nginx .conf file for each domain (assuming your config is in /etc/nginx/conf.d/)
Issue the command: nano /etc/nginx/conf.d/1st_domain.conf and put in it the following:
server {
listen 80;
server_name 1st_domain.com www.1st_domain.com; # root /var/www/1st_domain;
index index.html index.htm index.php;
client_max_body_size 1000M;

location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
access_log off;
expires 30d;
}

location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
deny all;
}

include php;

location ~ /\.ht {
deny all;
}
}

and the same for each domain (note that all website files should be stored inside /var/www/)
and finally change ownership of the entire dir /var/www to your webserver (usually it's www-data)
Restart nginx, and you're done :)
Have another answer? Share your knowledge.