Question

Generate an ssl certification for subdomain

I have two droplets and one of them was assigned to my domain (domain.com). It was deployed directly (without docker or kubernetes) and nginx was secured with let’s Encrypt. In my second droplet, a project was deployed as an image. I want to assign that image as a subdomain (like subdomain.domain.com) and generate an ssl certificate for it. Is it possible to use projects in different droplets in one domain as subdomain and give ssl certificate?


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.

Hi there,

Yes, this should not be a problem at all. As your subdomain name would be hosted on a Droplet, you can follow the steps on how to issue a free Let’s Encrypt SSL certificate here:

https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-20-04

In order for Let’s Encrypt to be able to validate your subdomain name, you need to set the A record for your subdomain pointing to the Droplet’s IP address.

Hope that this helps!

Best,

Bobby

Hi @FriendlyLightSeaGreenBoat,

Yes, it’s possible. All you need to do is create an entry for your Subdomain in your DNS zone and point it to the droplet you want.

Once you have the droplet there, what you can do is use Let’s Encrypt again the same way you’ve used it to encrypt your first Droplet.