I have a domain http://blabla.com
which points to an ip address 103.35.123.4.12
. I then have a sub domain http://mew.blabla.com
which points to the same ip address. Using nginx how can I differentiate between the two domain names? I currently have the following:
server {
listen 80;
server_name blabla.com;
location ^~ / {
}
}
server {
listen 80
server_name mew.blabla.com;
location ^~ /mew/ {
}
}
Currently both blabla.com and mew.blabla.com redirect to the root directory, how can I create a server block for the sub domain?
EDIT: Currently mew.blabla.com is not being recognised as the subdomain, is it a problem with both domains sharing the same IP?
root
configuration (which tells nginx from where to serve files) andlocation
doesn't do what I think you think it does (for example, that last one only matches requests formew.blabla.com/mew/
)