Been playing with nginx for about an hour trying to setup mass dynamic virtual hosts. If you ever done it in apache you know what I mean.
Goal is to have dynamic subdom
Perhaps doing this will get you where you want to be:
server { root /sites/$http_host; server_name $http_host; ... }
I like this as I can literally create sites on the fly, just create new directory named after the domain and point the DNS to the server ip.