Report this

What is the reason for this report?

How to setup vhosts in the DNS page in settings

Posted on December 9, 2012

I’ve setup an ubuntu server with LEMP and phpmyadmin and I’ve managed to setup an nginx vhost using your tutorial. However, I couldn’t see my vhost site until I added an entry on the DNS setup page. Now I see a site, but it’s the index.html file in my default web root, not my new vhost web root. But, there’s nowhere to specify the web root on the DNS setup page, so how do I let DNS know about the site, but then make sure requests go to the right web root on my server?

I’m new to this stuff, but I have to say the tutorials and interface (other than this issue I’m confused on) are great and I’m having fun learning!



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!

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.

DNS is purely used to map domains and subdomains to the IP of the server. <br> <br>Which files are served from which directory on the server based on the domain you specified is all handled by your web server, in this case nginx. <br> <br>The issue you mentioned either indicates that there is an issue with your nginx config, or if everything is correct that you may not have restarted it after making modifications. Anytime you change the nginx config you need to restart the service. <br> <br>If you paste your nginx config for the domain in question we can see if there are any possible errors in it. <br>

I got it working. I was having issues with a server block that didn’t have the ‘www’ part in it. Live and learn. ;) <br> <br>So, do I need to create an entry on the DNS page for each domain/subdomain that I add to my server before it’ll be browsable?

Looks like that’s the case. Thanks!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.