在nginx的http模块下面,一个server就可以看做一个站点,配置形式大概是这样的:

http {
  index index.php index.htm index.html;
  server {
    server_name www.site1.com;
    location / {
      # [...]
    }
  }
  server {
    server_name site2.com;
    location / {
      # [...]
     }
    location /foo {
      # [...]
    }
  }
}

 

posted @ 2017-03-26 22:29  杨广伟9527  阅读(350)  评论(0编辑  收藏  举报