首页 > 开发 > Nginx > 正文

nginx 虚拟主机设置实例(多网站配置)

2020-07-28 15:39:14
字体:
来源:转载
供稿:网友
Nginx 虚拟主机设置一例,主要是针对虚拟主机的设置,多网站配置方法,需要的朋友可以参考下

配置文件:
复制代码 代码如下:
    http { 
     server { 
     listen          80; 
     server_name     www.domain1.com; 
     access_log      logs/domain1.access.log main; 
     location / { 
     index index.html; 
     root  /var/www/domain1.com/htdocs; 
     } 
     } 

     server { 
     listen          80; 
     server_name     www.domain2.com; 
     access_log      logs/domain2.access.log main; 
     location / { 
     index index.html; 
     root  /var/www/domain2.com/htdocs; 
     }
     }
    }

说明:
只要在模块里面新增模块;具体的根据您的实际需求去配置。

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表