server {
listen 80;
server_name *.xx.com;
access_log off;
index index.html index.htm index.php;
root /data/wwwroot/www.xx.com;
if ( $host != "www.xx.com" ) {
rewrite (.*).xx.com www.xx.com/$1 ;
}
www.xx.com root directory / data/wwwroot/www.xx.com;
bj.xx.com is to point to / data/wwwroot/www.xx.com/bj