您的位置:首页 > 运维架构 > Nginx

nginx使用include配置多虚拟主机

2014-05-05 15:32 246 查看
####设置http服务器

http {

    ####文件扩展名与文件类型映射表

    include       mime.types;

    ####默认文件类型

    default_type  application/octet-stream;

    sendfile        on;

    keepalive_timeout  65;

    #虚拟主机

    server {

         listen  8081;

         server_name   localhost;

         charset utf-8;

#         access_log   logs/aa.access.log info;

         location / {

             root  html/aa;

             index index.html index.htm;

         }       

    }

    server{

          listen  8082;

          server_name  localhost;

          charset utf-8;

 #         access_log logs/bb.access.log  info;

          location / {

                 root html/bb;

                 index index.html;

          }

    } 

   include  /usr/local/nginx/conf/vhosts/*;    

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  nginx