Nginx 是一个虚拟主机配置高性能Web和反向代理服务器必背的服务,它具有很多非常优越的特性:在高连接并发的情况下,Nginx是Apache服务器不错的替代品,能够使网站虚拟空间同时支持高达50,000 个并发连接数的响应。 //对域名aaa.itnetcn.com server { listen 80; //监听端口号 server_name aaa.citnetcn.com; //主机名称 access_log logs/itnetcn.com_access.log combined; location / { index index.php index.html index.htm; //默认首页文件 root /www/aaa.itnetcn.com; //网站目录 } } //对域名bbb.itnetcn.com server { listen 80; //监听端口号 server_name bbb.itnetcn.com; //主机名称 access_log logs/bbb.itnetcn.com_access.log combined; location / { index index.php index.html index.htm; //默认首页文件 root /www/bbb.itnetcn.com; //网站目录 } } //对域名www.itnetcn.com,itnetcn.com和除了aaa.itnetcn.com,bbb.itnetcn.com外的所有*.itnetcn.com server { listen 80; //监听端口号 server_name www.itnetcn.com itnetcn.com *.itnetcn.com; //主机名称 access_log logs/www.itnetcn.com_access.log combined; location / { index index.php index.html index.htm; //默认首页文件 root /www/www.itnetcn.com; //网站目录 } } (责任编辑:IT) |