I\'m new to Nginx and I\'m trying to get subdomains working.
What I would like to do is take my domain (let\'s call it example.com) and add:
Add A field for each in DNS provider with sub1.example.com and sub2.example.com
Set the servers. Keep example.com at last
As below
server {
server_name sub1.example.com;
# sub1 config
}
server {
server_name sub2.example.com;
# sub2 config
}
server {
server_name example.com;
# the rest of the config
}
sudo systemdctrl restart nginx