将所有y116.com与abc.y116.com域名全部自跳转到http://www.y116.com代码:
server
{
listen 80;
server_name y116.com abc.y116.com;
index index.html index.php;
root /data/www/wwwroot;
if ($http_host !~ "^www.y116.com$") {
rewrite ^(.*) http://www.y116.com$1 redirect;
}
........................
}

看完了要说点啥么?