Site in subdomain (MaraDNS + Nginx)
Posted
by
Grzegorz
on Ask Ubuntu
See other posts from Ask Ubuntu
or by Grzegorz
Published on 2012-08-29T15:31:06Z
Indexed on
2012/08/29
15:50 UTC
Read the original article
Hit count: 423
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?
© Ask Ubuntu or respective owner