A question can only have one accepted answer. Are you sure you want to replace the current answer with this one?
Changed your mind?
You previously marked this answer as accepted. Are you sure you want to unaccept it?
Subdomains not working with nginx
Posted February 6, 201413.1k views
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!