By Kyle Tozer
After setting up my Ubuntu 16.04 droplet by following the documentation supplied by Digital Ocean, I noticed that my droplet will serve up content intended for my domain under any miscellaneous subdomain that is typed into the address bar.
Ideally, I would like to redirect these non-existent *.mydomain.com addresses to mydomain.com and still have subdomains that I have created serve up their intended content.
Thank you ahead of time to anyone that can assist me with my question; I have not done any configuration to the default NGINX server block file beyond the initial droplet set up using the Ubuntu 16.04 set up guide on Digital Ocean.
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!
Hello,
In this case, what I would recommend is keeping the default Nginx server block so that all unused subdomain names are redirected to your main site, and then creating separate server blocks for each of the subdomains that you would like to use.
Here’s a step by step guide on how to setup that:
Regards, Bobby
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.