nginx 默认虚拟主机
vim /usr/local/nginx/conf/nginx.conf
# 增加
include vhost/*.confmkdir /usr/local/nginx/conf/vhost
vim /usr/local/nginx/conf/vhost/default.conf
# 加入
server {
listen 80 default_server; # 有这个标记的就是默认虚拟主机
server_name aaa.com; # 域名,空格隔开多个
index index.html index.htm index.php;
root /data/wwwroot/default; # 网站根目录
}mkdir -p /data/wwwroot/default/
echo “This is a default site.”>/data/wwwroot/default/index.html最后更新于