http {
xxx;
xxx;
xxx;
server {
listen 80;
xxx;
xxx;
if ($host = a.baidu.com) { set $hf dl ;}
if ($host = b.baidu.com) { set $hf fx ;}
if ($host = c.baidu.com) { set $hf hy ;}
root /home/wwwroot/www/$hf;
xxx;
xxx;
}
}
http {
xxx;
xxx;
xxx;
server {
listen 80;
xxx;
xxx;
if ($host = a.baidu.com) { set $hf a ;}
if ($host = b.baidu.com) { set $hf b ;}
if ($host = c.baidu.com) { set $hf c ;}
if ($host = d.baidu.com) { set $hf d ;}
root /home/$hf;
xxx;
xxx;
xxx;
}
}