Question

creating a sub-domain from a domain configured another server

Hi,

I created an instance on DO for hosting mongo as my current host does not offer it. I want to make a subdomain for that mongo instance so that I can add SSL, but curious if I can do that if my domain is pointed at a different server.

I own the domain name so I can configure it however I want but I’ve never done such a thing and wanted to know if its possible and how.

Thanks


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.

Accepted Answer

This can be done.

after installing mongodb on your droplet…

Setup your subdomain to point at the IP of your droplet. Install certbot for Letsencrypt - https://certbot.eff.org/ You will need to setup and configure a webserver to answer certbot on port 80 - NGINX and/or HAProxy should suffice

After a successful cert issue you should be able to configure mongo with the LE cert - you may need to leave HA/NGINX in place to answer on port 80 for the renewals

I would suggest using HAProxy as you can configure all your http traffic through there on the droplet.

I’m not very familiar with mongo still let me see if I can help.

Yes it’s totally possible to use SSL for the domain as well as subdomain. Subdomains are nothing more that an A or a CNAME record. SSLs work over any port so just make sure that port is accessible on the internet.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

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

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.