Question

DNS Records fails

  • Posted on December 12, 2013
  • grmmphAsked by grmmph

I am running two node apps on one droplet, and using nginx. Yesterday I was setting two domains leading to two different ports on my droplet web server: www.domain.com - > http://localhost:9001 sub.domain.com - > http://localhost:9002

This is what I have done on nginx/sites-available/default to make it happen:

server { listen 80;

server_name domain.com www.domain.com;

location / {
    proxy_pass http://localhost:9001;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
}

}

server { listen 80;

server_name sub.domain.com;

location / {
    proxy_pass http://localhost:9003;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
}

}

It was working perfectly, but now I see that the nginx make the proxy pass only for the main domain, while it does nothing to the sub domain. (yes, both ports are working when accessing m.y.i.p:9002)

Also, I am getting this error on the Digital Ocean DNS log: dns_master_load: /dev/shm/bind/DO/db.grmmph.com:15: *.grmmph.com: CNAME and other data zone grmmph.com/IN: loading from master file /dev/shm/bind/DO/db.grmmph.com failed: CNAME and other data zone grmmph.com/IN: not loaded due to errors.

Any help? Please?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

hey, I got the same problem as you mentioned at last, would you please tell me how to solve it? thanx!

Solved by support guys! Thanks!