作者:phperint | 来源:互联网 | 2017-06-23 08:33
//对域名aaa.example.com
server {
listen 80; //监听端口号
server_name aaa.centoscn.com; //主机名称
access_log logs/entoscn.com_access.log combined;
location /
{
index index.php index.html index.htm; //默认首页文件
root /www/aaa.entoscn.com; //网站目录
}
}
//对域名bbb.entoscn.com
server {
listen 80; //监听端口号
server_name bbb.entoscn.com; //主机名称
access_log logs/bbb.entoscn.com_access.log combined;
location /
{
index index.php index.html index.htm; //默认首页文件
root /www/bbb.entoscn.com; //网站目录
}
}
//对域名www.example.com,example.com和除了aaa.entoscn.com,bbb.entoscn.com外的所有*.entoscn.com
server {
listen 80; //监听端口号
server_name www.entoscn.com entoscn.com *.entoscn.com; //主机名称
access_log logs/www.entoscn.com_access.log combined;
location /
{
index index.php index.html index.htm; //默认首页文件
root /www/www.entoscn.com; //网站目录
}
}