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:
The mistake is putting a server block inside a server block, you should close the main server block then open a new one for the sub domains
server {
server_name example.com;
# the rest of the config
}
server {
server_name sub1.example.com;
# sub1 config
}
server {
server_name sub2.example.com;
# sub2 config
}