I am new to Nginx, switched 2 days ago from Apache.
With Apache my website had 1 main url (www.example.com & example.com) and 2 subdomains (s1.example.com & s2.example.com).
I succeeded to configure Nginx to work with PHP but I have 1 major problem:
In the config file, inside a server block I've set
server_name example.com www.example.com
Underneath it, in another server block, I've set (With a different root)
server_name s1.example.com s2.example.com
Also, I have all example.com, www.example.com, s1.example.com and s2.example.com pointed to localhost IP in /etc/hosts file (and the domain CNAMEs for www, s1 & s2 are all set to example.com).
The problem is that every url I access to giving me the same as example.com. All the URLs mentioned gives me the same page (index.html in example.com).
Are there a something wrong in my config file?