By info286582
Hi, we would like to have 3 subdomains resolving to the same IP (same droplet) but pointing to 3 different servers that will be running on it.
The servers were developed in GO programming language (golang).
One domain will be the API serving on port X: api.domain.com
Other one will be our Admin Dashboard on port Y: admin.domain.com
And the last one will be our website running probably on port Z: www.domain.com
How can we config the DNS to accomplish our desired setup? Can you help us with that?
Thank you very much in advance.
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!
I believe this is the updated article: https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04
Firstly, create a DNS record for each of the subdomains. The DNS records tell the browser which server/IP address it should connect to. Browsers assume port 80 by default. <br> <br>In order to map each subdomain to a different port, you will need to use a reverse proxy such as nginx. <a href=“https://www.digitalocean.com/community/articles/how-to-set-up-nginx-virtual-hosts-server-blocks-on-ubuntu-12-04-lts--3”>https://www.digitalocean.com/community/articles/how-to-set-up-nginx-virtual-hosts-server-blocks-on-ubuntu-12-04-lts--3</a>. <br> <br>You will need to insert <a href=“https://p.kk7.me/pohabekuhu.nginx”>this</a> into each virtualhost instead of the virtualhost config in the said article.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.