2012-07-16 83 views

回答

5

您必须创建两个虚拟主机使用server块。

让我们假设/var/www包含domain1.comdomain2.com目录与任何HTML页面,CGI脚本,...

server { 
    listen   12.34.56.78:80; 
    server_name  domain1.com 

    index   index.html; 
    root   /var/www/domain1.com 
} 

server { 
    listen   98.76.54.32:80; 
    server_name  domain2.com; 

    index   index.html; 
    root   /var/www/domain2.com 
}