How to setup a droplet to serve a subdomain on a different domain

I have a domain and I set up a subdomain ( which has SSL certificate associated with it with a redirect configured from HTTP to HTTPS which points to a droplet on DO, DNS record is properly setup.


When I visit the link I get “no server IP address could not be found” or no data is added on the droplet as a domain and when I try to install letsEncrypt SSL certificate using ( I get unable to install the certificate but the certificate and chain are stored. How do I correctly setup the droplet so I can install SSL and be able to serve the request and return data when accesses through the subdomain

What do I need to do for the droplet to serve the subdomain request with data,

Show comments

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.

Site Moderator
Site Moderator badge
November 12, 2022

Hi @lclp,

Do you have a Nginx configuration file for port 80/HTTP for your subdomain?

It sounds like Nginx can’t find your subdomain as it’s configured on it. Check the following article on how to do it.

Hi @lclp,

The preferred method for redirecting HTTP to HTTPS in Nginx is to set up a separate server block for each version of the site. You should avoid redirecting traffic by using the if policy, as it can cause unpredictable server behavior. Redirect HTTP to HTTPS per site.

You probably have a misplaced policy in subdomain configuration. Feel free to share your subdomain block.


Sergio Turpín

Try DigitalOcean for free

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

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel
Get started for free

Enter your email to get $200 in credit for your first 60 days with DigitalOcean.

New accounts only. By submitting your email you agree to our Privacy Policy.

© 2023 DigitalOcean, LLC.