Question

Use a domain across multiple projects

  • Posted May 11, 2022
  • DNS

I have several projects configured in DO, each representing an environment of my app (dev, staging, prod). I have one domain. I would like to set up DNS so that subdomains point at different environments (dev.mydomain.com, staging.mydomain.com, mydomain.com).

I see in the DO dashboard where to add a domain, but it looks like it wants to associate a domain with an individual project. Is there a way to set up DNS so that one domain can be used across projects?

Subscribe
Share

Submit an 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.

Hi @proconnectapp,

All you need to do is to create a subdomain and point it to your Droplet/Project. Associating the domain with a project won’t stop you from doing that so do not worry.

In regards to other configurations, please do let me know if you need any other assistance.

Hii @proconnectapp,

What webserver are you using, Apache or Nginx?

You can solve it using Virtualhost, basically it is a way to virtualize a host.

Nginx - How To Set Up Nginx Server Blocks (Virtual Hosts) on Ubuntu 16.04

Apache - How To Set Up Apache Virtual Hosts on Ubuntu 16.04

Hope that helps ;)

Sergio Turpín