I’m trying to setup subdomains in my droplet but they not seem to work. I’ve followed the tutorials (all of them I believe). I have two domain names pointing to the server: domain1.com and domain2.com.
domain1.com works fine. domain2.com works fine. whatever.domain2.com redirects to domain1.com page. whatever.domain1.com redirects to domain1.com.
I’ve setup DO DNSs and nginx config files to handle all domains and subdomains but they don’t seem to work.
Is it a DNS issue or a nginx issue? I don’t know where else to look!
Thanks.
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!
I’m 100% sure you missed one important step to make it work. DNS record!! <br> <br>https://www.digitalocean.com/community/articles/how-to-set-up-and-test-dns-subdomains-with-digitalocean-s-dns-panel <br> <br>https://www.digitalocean.com/community/questions/how-do-i-setup-subdomains-for-my-droplet <br> <br>https://www.digitalocean.com/community/articles/how-to-set-up-a-host-name-with-digitalocean <br> <br>http://stackoverflow.com/questions/2861372/mydomain-com-a-record-or-cname <br> <br>It is exactly the same way you create your first vhost domain. The only difference is that you are going to add Cname or A record to your subdomain as indicated in the above link 3
Sorry for the delay. <br> <br>I realized I had a wrong CNAME record. I was entering ‘@’ instead of ‘subdomain.domain1.com’ <br> <br>Now I’m not redirected, but the pages are not found.
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.