绑定域名
server_name *.abcd.com;
获取主机名
if ( $host ~* (.*)\.(.*)\.(.*))
{
set $domain $1;
}
定义目录
root html/abc/$domain/;
location /
{
root html/abcd/$domain;
index index.html index.php;
}
server_name *.abcd.com;
获取主机名
if ( $host ~* (.*)\.(.*)\.(.*))
{
set $domain $1;
}
定义目录
root html/abc/$domain/;
location /
{
root html/abcd/$domain;
index index.html index.php;
}