Site in subdomain (MaraDNS + Nginx)
- by Grzegorz
Welcome,
Actually I'm doing some experiments on my VPS with Ubuntu. I've installed MaraDNS with Nginx. At this moment I've correctly launch static site which is available from Internet (maindomain.com).
In next step I want to add new site which will be available in subdomain, for example dev.maindomain.com. I've tried to db.maindomain.com file (used by MaraDNS):
maindomain.com. xxx.xxx.xxx.xxx
www.maindomain.com. CNAME maindomain.com.
dev.maindomain.com. xxx.xxx.xxx.xxx
Where xxx.xxx.xxx.xxx is VPS IP address.
In nginx.conf I have:
server {
listen 80;
server_name maindomain.com;
access_log /var/log/nginx/maindomain.com.log
location / {
root /var/www/maindomain.com;
index index.html;
}
}
server {
listen 80;
server_name dev.maindomain.com;
access_log /var/log/nginx/dev.maindomain.com.log
location / {
root /var/www/dev.maindomain.com;
index index.html;
}
}
With this configuration maindomain.com works properly, but dev.maindomain.com isn't available.
When I try:
ping dev.maindomain.com
then I get my xxx.xxx.xxx.xxx IP.
Do you have any suggestions how can I resolve this problem?